That's not serious if you just fall, but if you are hit by a car the helmet can fly apart in the initial contact and leave you bare-headed for the crack on the pavement. Newer helmets from the late 1980's and the 90's are less simple. First look to see what standards sticker is inside. If it's ASTM or Snell, the helmet was designed to meet today's standards for impact protection, and you may even find that Consumer Reports has tested it. Most manufacturers now recommend that helmets be replaced after five years, but some of that may be just marketing.
Deterioration depends on usage, care, and abuse.
But if you ride thousands of miles every year, five years may be a realistic estimate of helmet life. And helmets have actually been improving enough over time to make it a reasonable bet that you can find a better one than you did five years ago. It may fit better, look better, and in some cases may even be more protective. Somebody is spreading rumors that sweat and Ultraviolet exposure will cause your helmet to degrade. Sweat will not do that.