if you fast charge your device it may get very warm, and may pause charging at 80% and display a message saying that charging has paused, and will resume when the phone cools down. This is normal when fast charging. It also won’t prevent you from using any app you have on your phone.
Some apps that use a lot of energy or that use cellular data rather than Wi-Fi can cause the phone to run warmer. Worst offenders are Meta products (Facebook, WhatsApp, Instagram, etc), interactive games, watching streaming videos, the Camera app and any other app that uses the camera (TikTok, Snapchat, etc). Charging while using apps will also generate a lot of heat. And having VPN installed, whether using it or not, can also consume a lot of energy. But none of these can cause “overheating;” iOS will limit energy use to keep the phone safe, perhaps by dimming the screen.
Lately there have been reports of the Amazon app and Words With Friends 2 using excessive amounts of energy, which, as already said, can cause the iPhone to heat up. And periodically other app releases may not have been thoroughly tested that will cause similar symptoms.
All of these are manifestations of the 2nd Law of Thermodynamics.