The molecules on the liquid surface experience net downward force. So to bring a molecule from the interior of liquid to the free surface, some work is required to be done against the intermolecular forces of attraction, which will be stored as potential energy of the molecule on the surface.