Dialect is a special form of speaking belonging to a group. Register is a linguistic term used to describe changing how one talks based on the situation.
I will be using To Kill a Mockingbird by Harper Lee as an example to demonstrate the difference between dialect and register. First of all, dialect is the way a group of people talk. This book takes place in the south, and there are two dialects: the Negro dialect, and the Southern dialect.
Here is a conversation between a child and her housekeeper about her older brother in the Southern dialect.
"Don't you fret too much over Mister Jem--' she began.
"Yeah, he's just about Mister Jem now.
"He ain't that old," I said. "All he needs is somebody to beat him up, and I ain't big enough." (ch 12)
You can see several elements of the Southern dialect. First of all, words like “fret” are Southern favorites, and so is the idea of calling a young man 'Mr.' Finally, there is “ain’t” instead of “isn’t” or “am not.”
Here is an example of the Negro dialect.
"I picks for Mr. Link Deas."
"Were you picking cotton in November?"
"No suh, I works in his yard fall an' wintertime. I works pretty steady for him all year round, he's got a lot of pecan trees'n things." (ch 18)
As you can see, a dialect is not usually a completely different language. Depending on the severity, you can usually mostly understand what the person is saying, although there may be one or two unusual words you don’t know and some unusual grammar.
In this same book, the children have a black housekeeper. One day they go to church with her, and are startled to hear her talk differently than she does with them. When she is with the children, she talks like them in what they consider proper English. When she’s at church, she talks like the other Negros. This is an example of different registers, and one person switching between the two in order to fit in socially.
"Suppose you and Scout talked colored-folks' talk at home - it'd be out of place, wouldn't it? Now what if I talked white-folks' talk at church, and with my neighbors? They'd think I was puttin' on airs to beat Moses." (ch 12)
As the children learn, registers are an aspect of your social group. If you use the wrong register with one, such as “proper” English, you will be seen negatively. Informal language is used at church, with that social group, and proper English is used at work.
There is not necessarily value tied to different registers, although some are seen as higher and more formal.
“You're not gonna change any of them by talkin' right, they've got to want to learn themselves, and when they don't want to learn there's nothing you can do but keep your mouth shut or talk their language." (ch 12)
In this case, as the housekeeper says, it is actually rude to use the wrong register even if you are talking in a way that another group would consider proper. Use the wrong register, and you risk standing out and being inappropriate.