I've been through a lot of writing workshops. I've listened to a lot of people talk about how to improve your work to get it published. I've had lengthy conversations about craft with published authors. But rarely does the issue of the setting come up.
The setting is defined as the time and place in which a book happens.
Sometimes, especially in literature, the setting is nebulous - it is cobbled together to look like a real place - say, modern Germany or 6th century China, but doesn't contain enough information to actually pinpoint the exact location in relation to a real world place. And that's fine.
Notice, though, in my distinctions above about the setting - both included a timeframe for the elements of the story. Even contemporary stories, set in the present day, have a time element to them, in addition to the place. Remember that books are generally written to last forever, so don't be afraid to anchor your work in a certain year or even month of time.
Setting is generally dependent on the book's other characteristics. The plot, most often, decides the main setting of the story. If you're writing a Jane Austen parody, then your setting is Regency England, more specifically, the manors of the ruling elite of that period, with a splash of London for color. Characters, too, can sometimes influence the setting. If you make a character from the American south and suddenly decide you need them to go home again, the south becomes your setting.
Do not assume your setting, even if influenced by other book characteristics, cannot be changed. Often, in the first draft of a novel or story, writers have a clear vision in their heads of the who/what/when/where/why. In the second draft, these might change. But writers don't frequently ask themselves about the setting - if I change the setting, can I elevate this story to have a stronger emotional impact?
The setting, like the plot and the characters, should be supporting the book's theme. The theme (the message or central idea the book is trying to get across) is one of the most elusive aspects of the book, because the writer doesn't really want to write it out like a thesis in a school paper. But by using the setting to help set up the theme, the writer has a better chance of making themselves understood.
To see if your setting is the right one, first, ask yourself what your theme is. (Often, writers forget to actually articulate for themselves what their big idea is.) Next, take your current setting and change it to someplace else, whether it be a differet timeframe or place or even to parallel a real-world event. Does any of these new setting enhance the story? If they do, then you have your new setting.
How can a setting enhance the story? If you're writing a book about teenage rebellion, originally placed in the modern American Midwest but not having really anything to do with that culture's sociological milieu, then change it to a revolution in the Middle East, or the French revolution, or another societal rebellion. Your character doesn't even have to be involved in the rebellion or even affected by it, but it enhances your theme by simply giving a historical credence to the idea of rebellion. In other words, you can pick a setting that reinforces your theme.