In literature, setting is defined as the historical time and geographic location in which a story's action occurs. The setting of a story also involves social environment that includes elements of culture and time period.
The setting of a story is highly important to the plot and characters. The location of a story sometimes determines the entire course of action for the plot. For example, in "The Wonderful Wizard of Oz," Dorothy is swept by a cyclone into the Land of Oz. This jump-starts the plot of the novel and is the entire reason Dorothy goes on her journey. Setting also helps drive character development because people are so strongly shaped and influenced by their environment.
Setting is a defining feature for some works of literature, mainly the ones that involve fantasy worlds. In these cases, the world is often as memorable as the relationships between the characters and without that framework the story loses its appeal. For example, the "Harry Potter" series hinges on the reader's imagined idea of a magical school called Hogwarts.
The setting of a story can be a real place, a fantasy location or some combination of both. Tolkien's Middle Earth in "The Lord of the Rings" series is a detailed fantasy world complete with history and lore that is as appealing to some as the story itself.