You're likely to get responses from a few years, to use it till you crash. You'll likely even hear that the recommendations to replace the helmet is a conspiracy promoted by helmet manufactures to get more of your money.
It is a fact that the shock absorbing properties of the foam in the helmet change over time and that is why a manufacturer typically has a recommended replacement time. Does that mean a helmet offers no protection after x years? Of course not. Just that it doesn't offer the same level of protection. Can you know exactly how much protection is lost after x years? Not that I know of.
Personally I tend to follow the manufacturers recommendation, but everyone makes their own choice in regards to safety and risk. I was in a serious motorcycle crash about 6 years ago and fairly confident I would not be writing this if not for the full face helmet I was wearing so I'm a bit biased on the helmet subject.