A strong modern trend is to wait until the child is around 26 months or older, can understand the concept and takes a personal interest in it, and has attained the physical abilities to recognize elimination urges and hold the pee until they can get to the toilet. It frequently takes boys longer than girls to reach the needed physical maturity, and some children are not able to be trained until they are 3.5 or 4 years old. But most begin to achieve success somewhere between 26-36 months.
When they are ready on all levels, kids are often eager to train, just as they were eager to walk and talk. At that point, training is more self-taught, and the parents are a helpful support team. The process might be a complete success in a day, or a week with diminishing accidents every day. Kids who are started well before they are ready may be "in training" for many months, until they have reached the needed physical and emotional maturity.
Night dryness is often a separate step, can't be taught, and happens in its own time. For some unlucky children, they are well into grade school before they begin to wake up dry. Pooping in the potty is also a separate step for some kids, occasionally happening before, but more frequently after, pee training.
But in practice, it can depend on quite a few factors, such as how you define potty-training, how much time and attention you are willing to give to the process, and your child's and your personalities. Here's a site that gives some great "readiness" checklists, plus the skinny on the various approaches to potty-training, their advantages and challenges.
http://www.parentingscience.com/toilet-training-readiness...