Depending on use, you should replace your helmet every 3 to 5 years according to helmet safety schemes. Keep in mind that glues, resins and other materials break down over time, while hair oils, sweat, cosmetics and the sun's UV rays add to the helmet's deterioration.
Note, a helmet is designed for only ONE impact. If it's dropped or suffers any blow, replace it immediately. Any impact can fracture the outer shell or compress the impact absorbing liner.