Your iPhone gets hot when using it because of heavy apps or processes that demand high processing power, like gaming, streaming, or using GPS. This causes the CPU to work harder, generating heat. Other factors include poor ventilation (using it while charging, for example) or high ambient temperatures.