JWST will probably last a while. Projected lifespans don't really mean much. It will have one actively cooled instrument that could run out of Helium some day, but the rest are passively cooled.
Besides the helium coolant, JWST's position in space is not completely stable and it needs to expend some propellant now and again to maintain its position.
There's a good chance that mission planners can achieve the full goal of 10 years, but the pessimist in me is worried about unexpected degradation of hardware components, resulting in restricted operations. I was kind of gutted by the loss of Kepler due to the reaction wheel failures despite it reaching its initial planned lifetime of 3.5 years. It was probably the best exoplanet hunter we've ever had and could have done more science if it wasn't for the crippling loss of the wheels.
Hubble too had hardware components degrading over time, but the greatest feature about it was the ability have it serviced up until the last shuttle mission. It couldn't have gotten to its 30th birthday without those upgrades and replacements.
I hope future large space observatories beyond the JWST get provisions to allow servicing by humans or robots.
But in a hundred years, when you ask just about anybody "What was the greatest telescope ever made?" the answer will be Hubble. There's a reason O'Keefe was almost strung up when he tried to cancel it.
Hubble is, in my opinion, like the Voyager of space observatories. They delivered a lot of breakthrough science, and opened our eyes to so much of the universe for the first time.