Are you charging the iPhone with the accessories that came with it?
Are you charging the iPhone in direct sunlight?
Take a look at this Apple doc -> iPhone, iPad, and iPod touch (4th generation): Keeping device within acceptable operating temperatures
If you think there is a problem, setup service for your iPhone.
My 4S has recently shut down twice so far due to heat: Once in 100+ deg. in Arizona, when I left the phone in direct sunlight too long (that'll kill anything), and once just today, 96 deg. in Colorado, with the phone in my shirt chest pocket, not in direct sunlight. Each time, the phone was also encased in the hermetically sealed "Lifeproof" case, which probably contributed to heat build-up. If you're using a similar case with yours, either make sure to keep the phone in a cooler, shaded area, or just take it out of the case when the temps are this high. Definitely don't leave it in direct sunlight! In my case, although the 4S seems more heat-sensitive than my previous iPhones, I still find this behavior within acceptable parameters. But I wonder whether the overheating episodes might cause permanent damage...?