When purchasing a dirt bike the height is determined by the
child's height not his or her age. The power is chosen by the
child's experience and comfort level.
That would depend on size, experience and if you are looking at a 2 or 4 stroke bike. If they have not been around bikes before I would suggest a smaller bike (80cc or 100cc) until they gain some experience and confidence. My best friends son was raised on bikes, starting racing at 5 years old, and by the time he was 12 he was on a 200 riding it very aggressively.
a good bike for a 12 year old boy is a 80cc or a 100cc