The amount of water vapour in the air depends on the weather and any excess is soon lost but carbon dioxide in the atmosphere lasts for over 100 years. More ….
Whether water vapour or carbon dioxide is more important in causing global warming is not simple to answer. Currently about 50% of the greenhouse effect is due to water vapour, 25% due to clouds, 20% to carbon dioxide, with other greenhouse gases accounting for the remainder.
So why aren't climate scientists a lot more worried about water vapour than about carbon dioxide? The level of water vapour in the atmosphere is determined mainly by air temperature and any excess is lost in a few days as precipitation (mainly rain or snow). On the other hand the level of carbon dioxide is determined by the fine balance between sources and natural sinks, and it would take centuries to return to pre-industrial levels even if all emissions ceased tomorrow. Other, even more powerful, greenhouse gases than carbon dioxide are emitted by mankind but because they occur in far smaller quantities their net effect is much smaller than that of carbon dioxide. Carbon dioxide is responsible for about two-thirds of the warming caused by greenhouse gases emitted by mankind.

Water vapour will play a huge role in global warming in future. The amount of water vapour about 5 -10 kilometres up in the atmosphere is expected to double by 2100, as temperatures rise, resulting in a warming effect roughly twice as much as today’s. However, water vapour increases as a consequence of the increase in other greenhouse gases and is not a primary cause of global warming itself.