After finishing an undergraduate degree, there’s four years of medical school and then three to seven years to complete a residency. Aspiring subspecialists might follow that up with a fellowship.