Armor (or "armour" as wasteful British typesetters would have you call it) is simply protective clothing that can provide a defense against melee weapons and missiles. It is not uncommon for armor to also protect against physical (or "elemental") spell attacks, such as a fire bolt or cold ball. Armor frequently inhibits spell-casting in some way and may provide some defense against non-physical spell attacks. It may also penalize some actions due to the restrictiveness of the armor. It is possible to have skills in wearing armor that reduce penalties related to the wearing of armor.
Armor in roguelikes usually is worn in parts, typically including most of the following:
In a science fiction roguelike, armor may provide environmental protection against toxic gasses or vacuum. It may have built-in weapons or other devices. It might have other features.
The protection offered by armor can take several forms: it can reduce the chance of a successful attack, it can reduce the damage done by a successful attack, and/or it can have a chance of deflecting an attack that would otherwise succeed. Damage reduction can be done by various methods, the most obvious and popular of which are (1) subtracting from the damage and (2) reducing the damage to some percentage of the normal damage. In either case, the amount may be fixed or it might be randomized.