A resident is a person who lives in a particular place permanently, or for an extended period of time, i.e. who maintains a residence or a domicile in that place.
A resident alien is a person who is living in a particular foreign country for an extended period of time under authority or color of law as opposed to a tourist who is visiting the country without the intent to establish a residence in that country.
A KGB-resident was the head of mission in a particular country, albeit usually officially assigned to a relatively subordinate diplomatic position.
In the US a resident at a hospital is a physician, or other medical professional, who has completed a specified level of schooling and an internship, and is now receiving specialized clinical training. See medical resident.
See also: Nationality