The setting and time period is a relevent part of of the action of most stories. Knowing the historical time period affects the understanding of the culture of the time. If a story is set in Puritan Early America, then I would expect to see and understand the importance of religion, strict moral codes, and conservative attitudes. If the story is set in the Depression, I would expect to see a the hardships and depriviation, and perhaps the hope for a better day to come.
Setting is equally important. Like with time, all characters are a product of their environment. Setting includes every detail that creates the physical backdrop--starting with large ideas like country, region and state, and progresses to small details like city, street, home, room.
A story such as "A Rose for Emily" relies heavily on time and setting. Only at the turn of the century, in a small Southern town, could a women who lives on the best street in town, in what was once a very fancy house get away with having a dead body upstairs for close to forty years with no one in the town having the guts to confront her about the smell or anything else for that matter. It is arguable that this story could not happen anywhere but the setting Faulkner created for it.