Apple has a built-in failsafe to protect against this. If the heat becomes too high then the screen will display a temperature warning and indicate that the device is shutting down until the temperature drops to an acceptable range. Of note, I've only ever seen that screen on my older (black) iPhones, using them as a GPS, mounted on the dashboard, during sunny summer days. Gaming, even heavy gaming, never earned me the thermal warning.
If the game is very intensive, then as suggested above, reboot the device to restore performance. I can't say why it happens, because the device is supposed to close apps properly and clear memory, but I know that I had occasions when playing Infinity Blade III where I'd have to reboot here and there to restore performance and prevent glitches.