Short answer is 10 years.
A junior doctor is a doctor undergoing an average of 10 years (range 8-12) further training, after 5 (range 4-6) years at medical school (university), to be a consultant (a.k.a. ‘boss’) – making a total of about 15 years (range 12-18 years) training.
For different types of doctor, the training is slightly different. For example, a GP does 5 years after medical school (making a total of 10 years) and then they can work independently.