Residency is a level of medical training. A resident physician or resident (called senior house officer or registrar in the United Kingdom, depending on the level of training) is a person who has gotten a medical degree and who practices medicine under supervision of other physicians, usually in a hospital. In the United States, doctors must complete residency before they can practice medicine without supervision.
Residency programs train doctors to work in a specific specialty, or field within medicine. For example, there are different residency programs for medicine, surgery, and psychiatry. In the US, the length of a residency program is different based on specialty. Residency in specialties like family medicine and psychiatry is usually three years long, but a residency program in neurosurgery (brain surgery) may be 7 years long.