The term dialect is generally used in one of two cases: colloquially, it refers to a sub-standard variant of language that is more distinct than an accent; linguistically, it refers to any variant of a language, including the standard dialect (a nonsensical term in the colloquial sense).
In writing, dialect is best omitted unless the writer truly has a great ear for it. Most who attempt dialect fail to do so well and instead thrust upon their readers inconsistent exaggerations. Dialect may slow down and make critics of otherwise passive readers, so use it carefully. If you must, stick to a dialect you know well, or study, listen, and read. Fine examples of dialect, both real and imagined, include A Clockwork Orange, Mason & Dixon, Riddley Walker, and Trainspotting.