Some heat is perfectly normal, especially when charging or running high-performance apps, though the phone should not become too warm to handle comfortably.
If your phone continues to get uncomfortably warm after confirming all of the above, you may need to factory reset your phone.
Note: Under normal operation your phone should never be hot enough to cause burns or other personal injury due to heat generated by your phone.