A candle can burn in zero gravity, but the flame is quite a bit different. Fire behaves differently in space and microgravity than on Earth.

Microgravity Flames

A microgravity flame forms a sphere surrounding the wick. Diffusion feeds the flame with oxygen and allows carbon dioxide to move away from the point of combustion, so the rate of burning is slowed. The flame of a candle burned in microgravity is an almost invisible blue, so invisible that video cameras on the Mir Space Station could not even detect the color. Experiments on Skylab and Mir indicate that the temperature of the flame is too low for the yellow color seen on Earth.

Smoke and soot production are different for candles and other forms of fire in space or zero gravity compared to those on earth. Unless airflow is available, the slower gas exchange from diffusion can produce a soot-free flame. However, when burning stops at the tip of the flame, soot production begins. Soot and smoke production depend on the fuel flow rate.

It isn't true that candles burn for a shorter length of time in space. Dr. Shannon Lucid (Mir), found that candles that burn for 10 minutes or less on Earth produced a flame for up to 45 minutes. When the flame is extinguished, a white ball surrounding the candle tip remains, which may be a fog of flammable wax vapor.