It is advisable to change it every 5 years.
With a high frequency of use, it is even quite reasonable to replace it more often!
As for motorcycle helmets, there is no obligation, but you still have to examine it from time to time!
MINIMALIST ADVICE
At least replace your helmet if it is more than 10 years old!
Your brain and teeth (if you have chosen an integral) will thank you.