I am regularly asked this question, and the answer simply is to wait for as long as possible. 2 ½ to 3 years is a good age as your child will begin to understand the concept of staying in bed, respond to rewards etc. If you move your child to a bed too young, your child will get out of bed frequently during the night, you will then go through a pain stacking few months of bringing your child back to bed. If your child is climbing out of the cot, your child will most definitely climb out of bed.
If your child climbs out of the cot, ensure the cot is set to the lowest level and there is no toys in the cot which your child can stand on to help him get out. You should make sure the child’s landing is soft and safe to avoid injury. Closely monitor your child every night and any time your child climbs out of the cot simple put him back in lying down and leave the room. Repeat this until your child gets bored of the game and goes back to sleep. Generally after a few nights of this they don’t bother doing it any more. This greatly reduces the chance of your child climbing out during the night when he goes into a light sleep, as it will take too much effort , he will turn over and go back to sleep. However if your child is too young when he goes to a bed, his first instinct when he wakes will be to get out of bed. As your child may not understand reward systems fully it will take a lot longer to teach your child to stay in his own bed.