Both these terms are usually taken to refer to regional varieties. An accent is a regional thing, but dialects can be social or occupational.
relates to the way things are pronounced (e.g. whether you say “grass” with a short or long “a” sound). RP is an accent.
relates to the words and grammatical forms you use (e.g. whether you call a bread roll a “batch” or a “cob” etc etc). Standard English is a dialect.
The two are related to a certain extent but can be separated. For example, it is possible to speak a dialect in a standard (i.e. non-regional accent) - but this is quite unusual. On the other hand, speaking Standard English in a regional accent is not so unusual. Many people pronounce things according to the local norm without using what they perceive as “bad” grammar (e.g. he weren’t etc).
Make sure you are clear on which is which, and on whether you are being asked to describe accent (phonological) or dialect (lexical & grammatical) features, or both.
Why do people use regional features?
Key ideas = Identity & Community
To distinguish oneself from other groups (Martha’s Vineyard and the “Summer People”)
To show solidarity (Martha’s Vineyard; Milroys’ Belfast Study)
To indicate a certain personality type/trait (Cheshire & “toughness index”)