Is energy released during change of state? When a substance changes state from solid to liquid, the temperature of the substance remains the same and the heat energy from the external source is converted to potential energy within the substance.
My question is that If I think of it in the reverse direction, I mean when the state changes from liquid to solid, will the potential energy that was stored be released as heat energy to the surrounding?
 A: Yes.
This is why steam burns more than hot water at its boiling point, for example. Steam contains a lot of extra energy by virtue of it being steam.
This energy is known as Latent heat. For example, a gram of steam gives out 540 calories if it is allowed to condense.
A: This is essentially the same as Manish's answer but from a slightly different perspective.
If you take the solid and liquid, or liquid and gas, or whatever the two phases are, then at the phase change the Gibbs free energies of the two components are the same because the two states are in equilibrium. The Gibbs free energy change in the transition is:
$$ \Delta G = \Delta H - T \Delta S $$
where $\Delta H$ is the change in enthalpy and $\Delta S$ is the change in entropy. The temperature $T$ is a constant because the phase change occurs at constant temperature. At the phase change temperature $\Delta G$ is zero so:
$$ \Delta H = T \Delta S $$
The enthalpy change $\Delta H$ is basically the heat emitted or absorbed during the phase change, and it's balanced by the change in entropy due to the phase change. For example when a liquid changes to a gas its entropy increases, $\Delta S$ is positive, and we shouldn't be surprised to see that this is balanced by heat being absorbed by the system (confusingly $\Delta H$ is negative if heat is given out and positive if heat is absorbed).
Conversely if gas changes to liquid its entropy is decreased, $\Delta S$ is negative, so $\Delta H$ is negative i.e. heat is given out.
So back to your question, this shows that heat is given out when the phase change goes one way and absorbed when the phase change goes the other way, and the magnitude of the enthalpy change is the same for example
$$ \Delta H_{liquid \rightarrow gas} = - \Delta H_{gas\rightarrow liquid} $$
I'm not totally comfortable with your statement the heat energy from the external source is converted to potential energy within the substance as I think this is a slight misuse of the term potential energy. The change in enthalpy is equated to a change in entropy rather than potential energy.
