Heat and relative energies

Energy may be transferred between a system (such as the flask with its water in it) and the surroundings as heat.

If you heat liquid water using a stove, heat energy is transferred from the stove element to the liquid water.
In this case heat is transferred from the surroundings to the system.
If you cool liquid water in the freezer, the heat energy is transferred from the liquid water to the freezer.
In this case heat is transferred from the system to the surroundings.
 
 melts
on heating 
(heat in)
endothermic


freezes
on cooling
(heat out)
exothermic
vaporises
on heating
(heat in)
endothermic


condenses
on cooling
(heat out)
exothermic
increasing energy of system
The flask containing all of the gas derived from the liquid sample would be MUCH larger than the one shown. 
Similarly if the gas in that flask is condensed the volume of liquid would be much smaller than that shown.

Exothermic and endothermic processes
 
gas

exothermicendothermic

liquid

exothermicendothermic

solid
E
Endothermic processes absorb heat energy from the surroundings.

The energy of the product(s) of the process is higher than that of reactant(s).
Examples:  melting of ice, boiling of water to give steam
Exothermic processes release heat energy to the surroundings.

The energy of the product(s) of the process are lower than that of reactant(s).

The reverse of endothermic processes are exothermic.
Example: Condensation of steam
This is why placing your hand in steam feels hotter than placing your hand in boiling water.
Heat is released from the condensation of the water vapor (steam) on your hand.