Helmets can be weakened by a lot of thingssun, for one. And sweat is fairly acidic, so that can obviously have an impact, particularly on the straps. A helmet may look perfectly fine, but be severely weakened compared to its brand-new condition.
Obviously, any physical damage to a helmet pretty much requires its immediate replacement. That means any impact hard enough to ring your bell, even a little, probably means the helmet should be retired. It may have invisible cracks, or attachment points for the straps could be weakened.
Manufacturers recommend that an undamaged helmet be replaced every five years, assuming moderate use. This does not sound unreasonable to me, and I adhere to that standard fairly closely.
Between replacements, I think it makes sense to clean the helmet occasionally by dipping it in warm water that's had a little Dawn detergent or Simple Green added. Sluice it around a little, rinse thoroughly, and air-dry. It'll smell better, for one thing, and you'll get that crusty sweat residue off.
Fortunately, you can almost always find last year's model helmets on sale, so you don't have to spend a ton. Nashbar, for instance, has a Bell Delirium helmet for $50, which is $45 off suggested retail (www.bikenashbar.com). Performance has the high-end Giro Atmos for $50 off, although that's still $140 (www.performancebike.com). And Cambria Bicycle has the very fine Bell Ghisallo for $75$25 off regular price (www.cambriabike.com).
So go forth, shop, and be safe.
Pick up a copy of the 2006 Outside Buyer's Guide, on newsstands now, for a look at 396 torture-tested products, including the 2006 Gear of the Year award winners and an all-new women-specific review section.