The air around you have weight, and it presses against everything it touches. That pressure is called atmospheric pressure, or air pressure. Once the candle burns almost all oxygen present in the glass is used in the burning process. Due to lack of oxygen inside the glass reduce the air pressure and candle stops burning. The expanded air starts to cool down so the air pressure inside the glass drops and this creates suction effect. The air present outside the glass applies pressure on the water and it rises in the glass until equal pressure.
Enjoyed this video? Why not check out one of these next!