This question is a bit vague. I am not sure whether you are asking how the setting affects people in a story or how the setting affects readers. I will answer the latter, since the previous answer examined the former.
The setting in a story sets the mood and more importantly, it cues a reader to expect certain things. For example, if the setting takes place in a creepy house, then the reader expected something of the horror genre. If the setting is a beautiful day at the beech, then something else is expected. So, the setting, without saying a word, speaks volumes. What is most interesting is when something unexpected happens in a setting. Many creative things can be done.
Setting is composed of time and place. Characters are products often of their culture and the prevailing social, economic, and geographic surroundings. For example, the farmers of the lowlands are less violent than the herdsmen of the highlands because they are not as defensive and paranoid of their livelihoods getting stolen.
Ask Odysseus the importance of setting. For 20 years he labored to return to his island home. He ventured to Spain, North Africa, Turkey, Italy--all through the Mediterranean--but we never see him so happy as when he tasted the goat's milk and cheese of Ithaca.
Setting can be a dynamic influence on characters: the Joads in the Grapes of Wrath are victims of the Dust Bowl of Oklahoma and victims of the exploitation of migrant workers in California.
Othello too is influenced by geography. In Venice, he is a man of reason and influence. Once isolated on the wild island of Cyprus, without the courts of governance, he is prone to self-destruction.
The novels and stories of Camus are set in the sweltering coasts of the French colony of Morrocco in North Africa where white, black, and brown men clash for status. In all these cases, setting is as important as the characters who inhabit them. In fact, some argue that setting sometimes plays the role of a character.