Setting can be extremely influential, affecting both events and characters in the story. In some cases, the setting becomes one of the most dominant force in the story, play, or novel. Think about the role of the arena in The Hunger Games, for example. The harsh environment controlled by the Gamemakers directed and influenced Katniss' every move during the Games. Another powerful example is the island in the Lord of the Flies, with its dark jungles and bright beaches; the isolation of the setting eventually reduces the British schoolboys to violent savages. Many times the author uses the circumstances of the environment and setting to introduce additional conflict into the story, whether it comes in the form of a violent storm, dark night, savage beast, or futuristic technology. Setting remains a vital element in shaping and delivering a relevant and meaningful story.
Considering that you are asking about setting in general terms and not for a specific book, there are a variety of effects that setting has on the events and characters in a story.
The setting can affect can affect any number of attributes related to a character or events. It may affect their attitude in response to the conflict of the story, the way they treat other characters, or even decisions they make. Certain events transpire simply because the setting of a story.
For instance, Atticus Finch in To Kill a Mockingbird, is affected by the fact that he lives in a prejudiced South. He chooses to fight (he's a lawyer) on behalf of Tom, an African-American. If the setting of Harper Lee's book had been Ohio, Oklahoma or California, it wouldn't have had the same unspoken effect.