On the basis of molecular kinetic theory of substances we know that the molecules of a substance always remain in motion. The molecules of a solid vibrate about a fixed point. The molecules of liquids and gases move at random in different directions.
Kinetic energy develops due to this motion of the molecules. Again attraction and repulsion forces are present among the molecules of a solid and this is the cause for the generation of potential energy. Among the gaseous molecules attraction-repulsion force does not exist and so there is no potential energy of temperature.
The sum of the kinetic and potential energy of the molecules of a substance is called its internal energy. Evidently a part of the internal energy originates from kinetic energy and the other part from potential energy.
If thermal energy is applied to a body then its internal energy will increase. But only the kinetic energy of the internal energy causes the raise of temperature of the body.