According to the kinetic model, the total energy of a molecule is the sum of kinetic energy due to its motion (which depends on temperature) and its potential energy (which depends on the force of attraction between the molecules and the separation between them.
When a solid is heated, initially, its temperature increases. Here, the heat absorbed by substance is used in increasing the kinetic energy of the particles (atomic, molecules, etc.) of the substance as well as for doing work against the forces of attraction between them.
As the heating is continued, at a certain temperature (melting point), solid is converted into liquid. In this case, the temperature remains constant and the heat absorbed is used for weakening the bonds and conversion into liquid phase (liquid state). This heat is called the latent heat of fusion.
When a liquid is converted into the gaseous state, at the boiling point, the heat absorbed is used for breaking the bonds between the atoms or molecules. This heat is called the latent heat of vaporization.
Some solids, under certain conditions, are directly transformed into the gaseous phase. Here the heat is absorbed but the temperature remains constant. The absorbed heat is used for breaking the bonds between atoms or molecules. This heat is called the latent heat of sublimation.
In general, latent heat is the heat absorbed or given out by a substance during a change of state at constant temperature.
In transformations from liquid to solid, gas to liquid and gas to solid, latent heat is given out by the substance.