The real answer is - it depends. There are many types of shingles; composition, shakes, terracotta, slate, concrete, thatch, etc..
Each type has a general timeframe of usefulness, although sometimes the shingle outlasts the fasteners! For more information check out the Life Expectancy chart on the FAQ on the top of the page.
Here in Houston the average dwelling comes with asphalt shingles which according to the book should be good for 25-30 years but with this hot Texas heat and humidity they typically fail earlier.
Signs of a deteriorating roof are discoloration of shingles, granule loss, curling or cupping, missing shingles, failed flashings, failed fasteners