Elio is right in assuming the relationship between the height and the hours it burns is proportional.
Find the unit rate
14 ÷ 8 = 1.75 cm/h
Divide
21 ÷ 1.75 = 12
You can set this up as an algebraic equation to check the answer.
If the candle is 21 cm tall, it will burn for 12 hours.