Flames heat a few layers of air nearby and make them less dense. Due to buoyancy this lot air moves vertically upwards creating a sort of low pressure near the flames. This causes the cool air from faraway layers to flow towards the flame form the sides and below. Oxygen present in the air keeps the fuel burning. The air near the flame gets heated very much and moves up faster. The dynamics of air flow near the flame is a complex process however mathematicians have modelled it and found that there is a greater (faster) outflow of hot air right above the flame with a smaller (slower) inflow from the sides and below. The hot air goes up and then mixes with the environment and cools down. This theory holds good only the candles or wick stoves and not for welders torch or the like where the fuel is forced in a particular direction.