The iPhone has over-temperature protection; if it gets too hot it will shut down and display a message saying it needs to cool off. If you don't see this message it hasn't overheated.