First, you need to evaluate different criteria based on whether your suspicion that you need a new roof is based on either a roof leak or a roof that is dirty (stains, moss, etc.) If the primary reason you think it is time for a new roof is because of a roof leak, you need to clarify a few issues regarding that leak.
Determine whether or not the roof leaks in a single or multiple locations, and whether it is in a location that has leaked and been repaired repeatedly. A single location, leaking for the first time, usually is not by itself going to be an absolute indication of needing to replace the entire roof. More likely that not, a single component of the roofing system (flashing, vent, a mis-nailed shingle) has failed but the rest of the roof still could be in decent condition. Leaks in multiple locations bode more ominous results.
If multiple locations are having shingles loosen, nails rise, flashing fail, the chance of the roof being worn out are much higher. When the same location has leaked and been repaired repeatedly, it may never have been adequately addressed and the same mistaken repair may be continuing to be performed. It will be critical to get an assessment for a roof leak repair expert as to whether there is something un-repairable or if the past repairs addressed the wrong issue. Don’t let one bad spot to cost you an entire new roof!
Next, look at the roof leak location. Is it below, or in somewhat of a direct path below a skylight, vent, or pipe? Is it possibly at a valley or roof intersection where either on sections of roof meets another or where the roof meets a wall? Or rather is it out in middle of roof field? Leaks at intersections and valleys usually do not indicate by themselves that a roof is finished. More likely, there are flashing issues. Leaks in the middle of a roof field with no nearby intrusions into the roof can be a bad sign.
Remember, there are very few leaks that are un-repairable. The issue becomes whether the roof has adequate remaining life to justify the repair’s cost.
If an unsightly roof (fungus or mildew stains or moss growth) is what is making you think you need a new roof, you need to learn more about what is under the stains or moss. There is not always a correlation to a dirty roof and it’s life being over. There are most certainly roofs that will not withstand even the gentlest possible roof cleaning without sustaining damage that puts it in poor condition. Particularly with moss, as experienced in the Portland Oregon area, there are some moss types and infestations that cannot be properly dislodged without stressing a roof. If a roof is on the borderline to start with, such a roof is best left alone and the funds save for going toward a new roof.