I could give a much quicker answer if you asked how the social environment does not influence our thinking, since that answer would be there are no circumstances in which it does not, unless a person lives in a cave, with no social environment whatsoever. Social environment has a profound influence on thinking. We may be born with some immutable characteristics, perhaps shyness, a talent for music, or a risk-taking personality, but whatever we are, we are fully formed by what is around us.
Our first social environment is our parents and perhaps extended family. We learn what is right and what is wrong very quickly in that environment, which is the beginning of an influence on our thinking. Don't think that toddlers cannot think! Their little minds are very busy. Our choices are guided by this early environment, what television might be permitted, what books are read, what songs are sung, what food is eaten. Our tastes are formed very early, based upon what is offered to us by those around us. All of these help to form our thoughts. Parents who do not speak enough to their young children actually limit their children's minds, and this shows up later on in school. Parents who are brutal to their children are helping to form brutal thoughts in their children. Research shows that children who have been abused are far more likely to be abusive adults. So, for better or worse, this early social environment contributes a great deal to our thinking, at the time and for life, really.
The next step a child takes into the world is usually school, a new social environment, in which teachers and classmates help to form thinking. Children must learn a new set of rules and are exposed to other children who have different ideas about things. I didn't know a thing about religious differences until I went to kindergarten, when a classmate asked me what religion I was and volunteered she was Catholic. Who knew? I had to start thinking in a whole new way. Children are little sponges, and they absorb the new social environment almost by osmosis, with a powerful effect upon their thinking.
Young people in high school and in college are powerfully affected by their social environment, gaining still more ideas, from their teachers (one hopes), and from their peers. Peer pressure has a tendency to make them think about behavior in a new way, one that is not always so good, but that is a part of growing up. If they have been brought up in a positive social environment, in which their parents were loving, communicated with them a great deal, and offered them good choices, that is often thinking that sticks and gets adolescents through these years successfully.
Once we leave school, we function in many different social environments. The workplace is one example. Working in a very informal culture tends to make us think less rigidly, while working in a very formal culture will influence our thought processes in the other direction. The groups we join influence our thinking. I belonged to a book group for about five years that I felt was making me a very gossipy and negative person, at least when I was there, which I did not like at all. The influence of this group crept up on me, until I finally stopped attending. I'm a much nicer person reading books all by myself. When it comes to politics, our social environment influences us as well, probably from birth to grave. Left-leaning people tend to have been raised by left-leaning people and gravitate towards left-leaning social environments, which reinforce and validate their thinking. The same is true of right-leaning people, too.
The answer to your question could truly be a book-length answer. The power of the social environment is comprehensive, affecting the thinking of every human being.