From Diablo Wiki
Defense is one of the key character stats in most RPGs, and Diablo II is no exception. Defense in D2 is equivalent to "armor class" in most games (it was called that in Diablo I); it's essentially a measure of the quality of your character's armor. Higher defense means fewer enemy hits land, though there's much more than that to it, of course.
- See the Defense 101 strategy guide for specific details about defense.
Raising Your Defense
A defense value is found on every piece of equipment in the game, except for weapons. (And some special weapons add defense too.) Hat, shield, chest armor, boots, gloves, and belt, all add defense. Rings and Amulets can have +armor properties as well. Your dexterity attribute also increases your defense, multiplying across the total armor value, and thus adding to your dexterity will add to your defense.
Charms can also be found with defense, and Armor Shrines will greatly increase your armor, for a short period of time.
To see your character's defense, open the character window. The defense value is displayed in a box just below damage and attack rating. To see how your defense stacks up in actual practice, hover the pointer over it. This will display the to/hit of the last monster type your character interacted with.
That said, the the defense display in the character window is an approximate value, and isn't necessarily accurate in all situations. It's part of the Lying Character Screen, after all.
Defense is a fairly easy value to raise, but it's not necessarily of great value to your character. For PvM play, defense must be very high to make a substantial difference. At low and medium levels the benefit is fairly negligible. Whether you want defense depends on your character as well. Melee characters generally add as much defense as possible, but many casters and ranged attackers virtually ignore it, since they don't get hit that often, and because when they do get hit it's usually by spells, which defense does not defend against.
A few key points, taken from the Defense 101 guide.
Does not reduce damage directly
Reduced damage mods, by % or straight values, reduce damage. Defense just makes you less likely to be hit by physical attacks.
Physical Attacks Only
Defense reduces the chance that a physical attack that uses Attack Rating will be successful. Only these types of attacks check your defense.
Defense does not work against elemental, poison, or magical attacks. It does work against physical attacks that have elemental damage added to them; if the physical misses, then so does the fire, cold, etc, damage stacked on it.
Defense is set to zero when running
While it's commonly said that defense = zero when running, this is not true. You are much more likely to be hit while running, but the actual game mechanism is that the entire to/hit formula is ignored, and that any attack that can hit will will deal damage.
The difference is that by ignoring the to/hit calculation, factors besides defense, such as Clvl and Mlvl are ignored also. Thus low level monsters that would often miss a naked high level character who was standing still, will usually hit that same character, if they are running (even if they have on heavy armor).
Numerous spells, auras, curses, and other effects affect your defense. Decrepify and Vindication lower your defense considerably. Enemies boosted by Blessed Aim and Fanaticism will have much higher to/hit, effectively lowering your defense.