You may need to clarify what you are looking for to get a more precise answer, because there are many paths to becoming a doctor, and many different paths to take in terms of speciality and subspeciality afterwards.
In general, to become a doctor one needs to complete an undergraduate degree and the necessary medical school pre-requistes and then complete the required 4-year medical school curriculm. Upon completion of medical school, the person will in effect be a doctor. However, the ability to practice certain specialities and get licensed will not have been acheived yet. Which is where residency comes into play. Residency is anywhere from 3-7 years with the surgical specialities taking 5 or more years ( I believe Neurosurgery and Plastics take the longest at 6-7 years) While many doctors will begin some form of practice after completion of their residency, others decide to do a fellowship in order to sub-specialize. Fellowships usually are 1-2 years in length.
So you see how long it takes really depends on what type of medicine an individual wishes to study/practice.
In general if you were to follow a standard path, with no devitations or early completions, and did the longest residency and fellowships, the length of time would be about 17 years give or take. (4 years UG + 4 years Med school + 7 years residency +2 year fellowship)