Usually 11 to 15 years after high school. That breaks down to 4 years of undergrad, 4 years of medical school, then 3 to 7 years of residency depending on the specialty you match into. Add another 1 to 3 years on top of that if you subspecialize into a fellowship.
Family medicine and pediatrics sit on the shorter end of residency length. Surgery, and especially cardiothoracic surgery, sit on the long end. Gap years are common enough now that plenty of us started our first year of medical school (MS1) at 24 or older, so don't treat the traditional timeline as the only normal one.