Though not always the dominant element in a story, setting is essential to give your story a sense of place and time. Setting might be a bare bones mention of time like: "It was a dark and stormy night" or it could be the main element as in Stephen Crane's "An Open Boat."
Setting accomplishes: visualization, characterization, and mood or tone, to give the story verisimilitude (the quality of appearing real or true).
It should have universality, so your readers can put themselves in the scenes with your characters. In her article, "The Universe in a Grain of Sand" (WRITERS DIGEST, April 1992) Nance Kress says: "If the setting is to have universality, it must be described with specific details, and those details must be chosen to illustrate some point of significance." She explains, for instance, if you're creating a motel room in Kansas whose distinguishing characteristic is its lack of distinction, don't describe the furniture in vague terms. Describe the collection of bland and mediocre furnishings - lamp, bed, dresser, framed print. The result will be universal anonymity attained through specific details.
How much detail should you use? The rule of thumb is to sketch your setting quickly and obtrusively, so it not only provides a place for the characters, but also a subtle statement on their emotions.
One pitfall some writers fall into is what's called White Room Syndrome. This happens when the story has no mention of time or place, whether the story is indoors, outdoors, in a house, or on a space shuttle.
Then you have the other extreme. Pages and pages of description weigh down the story's movement. It was fine to spend ten pages about the English countryside in Thomas Hardy's day. Times have changed. We have fast transportation, fast computers, and movies to take us where we want to go. We want instant gratification. Less is more. Use enough detail to make it real but not too much we forget who the characters are and detract from the scene.
Show details gradually rather than all in one chunk. Setting should not interfere with action. Don't employ description for the sake of description. If you mention an object, like say a gun or a doll, there must be some significance to it. Avoid overexplaining. If you mention someone retrieving her email, it's not essential to describe the computer, how she dialed in, connected, then scanned through her messages. Most people know about the process of retrieving email. On the other hand, if you mention beekeeping equipment, you might need to show the reader through action how it is used.
Choose your details carefully. Keep alert to:
The interior decorator in you who wants to label every piece of furniture and bric-a-brac in every room.
Your map maker who wants to provide endless charts and diagrams.
Your poet who wants to rhapsodize about every tree, bird, and flower
However, in a mystery novel, you need to give the reader a running inventory of objects. Knowing these objects is essential in solving whodunit. Make sure you show only the objects relevant to the mystery.
In creating a setting, you are creating a place that is unique. Use specifics. Don't say dog when you can say Golden Retriever, Pitbull, or Dachsund. The type of dog your character's neighbor walks every morning says something about the owner. Don't say tree. Instead say magnolia, palm, or pine. These reveal climate. Daffodils and chrysanthemums reveal season. A Queen Anne chair or La-Z-Boy gives us a peek at the character's history and tastes. What does it say about your protagonist if she uses milk crates for bookshelves and pasted on her wall a Degas picture torn from a magazine ad?
Avoid sameness in your scenes. Don't open all your scenes on a street corner or in bed. Have your characters visit different places.
If you're writing about places you've never been, research it thoroughly. You won't show all your newfound knowledge, but you should know the place well enough to convince the reader you've been there. Check and double check for accuracy. Your credibility and the story's can be destroyed by one inaccuracy. Avoid cliches in your descriptions. Don't describe men wearing striped shirts and berets standing by the Eiffel Tower if your story is set in Paris. London isn't always gray and foggy. There are interesting buildings in New York City other than the Empire State Building. Home in on specific details. The smells wafting from a patisserie, clip-clopping of horses' hooves, a line of yellow taxis' on Fifth Avenue.
When you visit a new place, pay attention to details. Ask questions. What's behind that fence? Why is there a crack there? Ian Fleming (James Bond novels) used to make a point of avoiding the well-traveled, well-lighted roads and instead favored the lesser known back streets. He felt that the unexpected turns and obscure details spoke more eloquently and gave him a sense of the city. Make a practice of noting details in your own town and ask how you can bring them to your fictional world.