The frequency in which you need to replace pipes is based on the pipe material used. Brass, cast iron, and galvanized steel have a lifespan of up to 100 years, copper can last over 50 years, and PEX and PVC usually last around 50 years.
If you live in a newer home, you probably don’t have to worry about replacing your pipes, however, if you live in an older home, consider having your plumbing system checked every two years to ensure it’s holding up.