Két is used before nouns and kettő alone (as a predicate). "Két alma van az asztalon." = "There are two apples on the table." "Hány alma van az asztalon? - Kettő." = "How many apples are there on the table? - Two."
(But in practice people sometimes use the kettő form before nouns, too. Especially as két sounds very similar to hét (7) in the spoken language. If you want to be unambiguous, you can always say kettő.)