The answer to 'when to replace roof' is that you typically need to replace your roof every 20-30 years, depending on the roofing material and local climate conditions. Asphalt shingle roofs generally last 15-25 years, while metal, tile, and slate roofs can last 40-70 years with proper maintenance. Signs it's time to replace your roof include curling, cracked, or missing shingles, extensive moss or algae growth, and leaks in your attic or ceilings.
Regularly inspecting your roof and addressing minor repairs can help extend its lifespan, but at a certain point the cost and effort of ongoing maintenance outweighs the benefits of a new roof. Consulting a professional roofing contractor is recommended to assess your roof's condition and determine the best course of action.