A residency program can last from three to eight years, depending on the specialty. Example. Pediatrics and family practice require three-year residencies, while general surgery takes five years, according to the American Medical Association.