We have written an FAQ article about this, as there has been quite a lot of discussion about it.
A little bit of warmth when charging or when your phone is being used extensively (e.g. multiple apps in use, gaming, etc.) is normal. However, if the heat is significant and doesn't dissipate even when the phone has been taken off charge (or apps have been closed etc.) it might be worth it to take it to a repair center.
Hope this helps!
Are you using the charger that came with the phone, and the original cable?