I love, love, love writing dialogue. Sometimes I get so caught up in writing dialogue, though, that I forget to break it up with physical description. Fortunately I have a friend, ahem Beth, who challenges me when I do this. As soon as she points it out I'm kicking myself in the butt because I totally see it.
So, lets talk about dialogue. When I read dialogue, I want it to sound like real people talking. If the dialogue is good, I get caught up in the conversation and I forget that I'm reading a story. I feel as though I'm there, with the characters, who in my mind are real people.
So making dialogue sound real is rule No. 1. And a preschooler sounds different than a teen and a teen sounds different than a 60-year-old. Middle-grade characters should not sound like 20-somethings.
Also, only one character should speak in a paragraph. (Technically, I guess that's a separate rule, but we'll make it rule No. 1.5)
Rule No. 2 is breaking the dialogue up with physical description. Was the protag staring at the sky, chewing her bottom lip so hard she made it bleed, wringing her hands? You know, the sort of physical description that anchors the protag's dialogue in the physical world.
And probably for me, Rule No. 3 would be not to overuse dialogue tags. That's the "he said/she said" stuff. Often by setting up the dialogue either through a physical action or description the reader knows who's talking.
One thing I'm always on the watch for, and sometimes Beth catches this in my writing, is allowing the back and forth conversation to continue too many lines without making it obvious who's speaking. I've found that it's often necessary to include the name of who's speaking after five or six lines of dialogue. Otherwise you drive your readers crazy because they're forced to count back to figure out who said what. Bad. Bad. Bad. Don't do this.
I think that dialogue is stronger when it stands alone in a sentence. Don't smuggle it into the middle of a paragraph. It loses its punch.
Good dialogue moves the story forward. Make sure yours does.
Other helpful posts:
Helping writers show, not tell
Writers use details to make stories come alive