When we heat up a liquid to turn it into a gas, there are three things we need to keep track of concerning the energy. First, we need heat to raise the temperature of the liquid (this depends on its specific heat capacity). Second, there is the latent heat of evaporation, which we need to supply to turn the liquid into a gas. Third, we need to consider that once we start turning the liquid into a gas, it expands and pushes away the air around it. This expansion against atmospheric pressure takes work, which corresponds to extra heat that we need to supply.
This last contribution for the total heat needed to vaporize the liquid is the key to your question, as the amount of work that the gas does when it expands depends on the surrounding pressure. Let's also assume that we add even more heat to raise the temperature of the gas well above its boiling point because the temperature of the gas starts to drop as soon as it starts rising (and we don't want the gas to start condensing right away).
(If you wonder why the gas cools down as it rises up, that's because with increasing altitude, the surrounding air pressure decreases and therefore the gas expands, which means that it is doing work. Therefore, its energy decreases.)
So after the gas has risen in the atmosphere, it has a lower temperature and a lower pressure. The lower temperature isn't really of our concern—we can just count the energy that the gas gave off when cooling down towards the energy that we get back now as we start to cool down the gas. The latent heat and the heat from cooling down the liquid (after the gas condenses) are also the same as when we first heated the liquid. But the last contribution to the energy has changed. When the gas starts to condense, it contracts so that now the surrounding air does work on our gas. However, as the pressure is smaller than at ground level, this work is smaller. Therefore, we get less energy back from the atmosphere compared to what we supplied when we evaporated the gas. This cancels the change in potential energy of the gas.