Carpet usually wears down overtime and needs replaced at least every 10 years.
Carpet doesn't last forever and even if it did I would never want to keep any carpet or flooring for longer than 10 years.
If I have the money I like to replace the carpet every 10 years or before just as a remodel and to refresh the house as remodeling the house is like getting a new home without moving.
I usually have the flooring in the dining room, bedrooms, bathroom, kitchen etc all replaced every 10 to 15 years just because I want something new and a new look to the house.
But for carpet 10 years is the max I would keep carpet and 10 years is a pretty long time when you think about it because 5 of those 10 years is 50 years and 10 of those 10 years is 100 years.
So if your carpet is 10 years old or older it's time to replace it even if it looks good still.