Dreams can inspire at different stages of writing. You may write an entire piece of flash fiction or only use one aspect of a dream - a character, imagery, setting, or mood as a seed for a new story. Night visions can also help solve problems you're having during revisions. Try reading your piece right before bed. The story may work itself into a dream and provide you with a solution.
Of course, you have to remember your dreams. Keep a notebook and pencil beside your bed. When you wake, write everything down right away. Once in this habit, you'll find your dreams become clearer and that you remember more often. In the middle of the night, I reach for my cell phone (no need to turn on the light) and tweet basic themes.
Dreams are often fantastical and wouldn't make sense translated directly to the page unless you write magical realism or science fiction. But similar to using real life experiences for inspiration, anything can be altered for the sake of story. A giant hairy monster chasing you can be written as a 6 feet tall stalker with hairy knuckles. That said, don't forget the nightmares.
What is your connection between dreaming and writing?
Stephen King, an excerpt from Writers Dreaming
5 Famous Books Inspired by Dreams