There are only three reasons your phone might be overheating when it's not due to the environment:
- Hardware problem
- iOS problem
- Program running requires a lot of resources
1 and 2 really require a device wipe in order to test for, since you're trying to avoid that, the only thing you can debug is 3. The easiest way to debug that is to reset your device (power off completely, then reboot) every morning after charging, then go about your day and make note of what apps you use, and whether your phone overheats or not. Rebooting it will make sure few to no apps are running.
If the overheating problem goes away then it's most likely a particular app that's causing the problem, though finding it is going to be difficult since it's one you don't use daily.
If the problem still happens occasionally, keep track of what apps you had run prior to it overheating, and see if there's a correlation, then try going a few days without using the app that shows up most often, and then try a few days using it every morning. That should give you solid evidence about whether the app is the culprit or not.
If there's no correlation between any particular app usage and overheating, then you're pretty much going to have to wipe it. Perform a backup, and take it to the store. Since you have to do a wipe anyway, you might as well do it once and get a replacement while you're at it. Apple takes overheating concerns very seriously and they should replace it without difficulty if it's under warranty.
If it's not under warranty, then it's worth wiping it yourself, updating the OS, loading just those apps you really need, and seeing if it still overheats. If the problem goes away, then restore the backup and see if it returns. If it doesn't return after the backup, then it was likely a corrupt iOS issue. If it does return after the backup, there's some app that's causing the problem. If the problem didn't go away after wiping and reinstalling the OS, then it's a hardware problem, and you should have it repaired or replaced.
From Apple's support page, hold the power button for 1.5 seconds and let go to get the power dialog. Don't hold it too long though, as it only takes 5 seconds to turn off the system without a proper shutdown.
You can also get the dialog immediately by holding control and pressing either the eject key or power button, or use the Apple menu to access the three options directly.
Best Answer
It would not do that until:
First the fans go at full speed for few minutes. You would hear that.
If that does not keep the temperature from climbing, it would cut down the CPU power. You would feel that in computer becoming sluggish (slow).
Normally the above is sufficient to prevent overheating.
If all that has failed it would not just shut down, it will try to shut down correctly.
Look in the Console for kernel[0]: Previous Shutdown Cause: ?
You could look in to Activity Monitor to see what is happening while under stress.
There is also a app called Istat that displays lots of parameters.