15 years.
Hubble was designed with an anticipated 15-year lifetime based on the expected integrity of the main mirror. It was believed that over HST’s 15-year life the space environment in low Earth orbit would cause sufficient degradation of the mirror that the telescope’s light-gathering capabilities would be severely damaged by cosmic rays and orbital debris.
Source: Assessment of Options for Extending the Life of the Hubble Space Telescope: Final Report
It is notable that Hubble was, from the start, intended to be a serviceable telescope. There were plans made before its launch and before the fault in the main mirror was found, to have astronauts visit the telescope to replace, repair and upgrade the platform. (This was a first. No prior satellite was designed to be serviced in space)
The main mirror would not be replaceable, and it was expected (or feared) that it would degrade over a time scale of about 15 years. It was clear, however, in 2005 that this degradation hadn't occurred, and so further service missions were carried out to maintain and improve the HST's operation, and boost it to higher orbits (compensating for drag).