A nonstandard dialect or vernacular dialect is a dialect or language variety that has not historically benefited from the institutional support or sanction that a standard dialect has.
Like any dialect, a nonstandard dialect has an internally coherent system of grammar. It may be associated with a particular set of vocabulary, and spoken using a variety of accents, styles, and registers. As American linguist John McWhorter describes about a number of dialects spoken in the American South in earlier U.S. history, including older African-American Vernacular English, "the often nonstandard speech of Southern white planters, nonstandard British dialects of indentured servants, and West Indian patois, [...] were nonstandard but not substandard." In other words, the adjective "nonstandard" should not be taken to mean that the dialect is intrinsically incorrect, less logical, or otherwise inferior, only that it is not the socially perceived norm or mainstream for public speech (though it is often stigmatized as such as a result of socially-induced post-hoc rationalization). In fact, linguists consider all nonstandard dialects to be grammatically full-fledged varieties of a language. Conversely, even some prestige dialects may be regarded as nonstandard.
As a border case, a nonstandard dialect may even have its own written form, though it could then be assumed that the orthography is unstable and/or unsanctioned, and that it is not consistently and/or officially supported by government or educational institutions. The most salient instance of nonstandard dialects in writing would likely be nonstandard phonemic spelling of reported speech in literature or poetry (e.g., the publications of Jamaican poet Linton Kwesi Johnson) where it is sometimes described as eye dialect.
Nonstandard dialects have been used in classic literature throughout history. One famous example of this is Mark Twain, The Adventures of Huckleberry Finn.  This classic piece of literature that is taught in school in the U.S. includes phrases from the characters that are not seen as standard English.
In the case of the English language, while it has become common thought to consider that nonstandard dialects should not be taught, there has been evidence to prove that teaching nonstandard dialect in the classroom can encourage some children to learn English.