According to contemporary cosmologists' best guesses, the universe will continue to last for an extremely long time, something over a googolplex years. A googolplex is a very large number — 1010100. Some estimates are even larger. The question of how long it will last is related to the question of how long the human species, or our descendants, will last, barring some disaster that wipes people all out prematurely.
It is known that the universe is expanding, but a frequent question is whether or not this expansion will continue indefinitely. Current signs indicate that not only is expansion occurring, but it is happening at an accelerating rate. This can be blamed on a universe-wide negative pressure, referred to as dark energy, the cosmological constant, or quintessence. The notion of a cosmological constant was first formulated by Einstein.
Prognostications regarding the lifespan of the universe are traditionally associated with its overall geometry. Its geometry is a function of its overall density. A critical value, omega (ω), comes into play here.
If the universe's density is more than ω, it is closed, meaning it has a spherical spatial geometry. In a closed universe, if a person travels far enough, she ends up back at her starting point, just like on the planet Earth. If its density is about equal to ω, it is flat, meaning that without dark energy, the rate of expansion would slow and asymptotically approach zero. If the density is less than ω, it is open, meaning that it has a negative overall curvature, and will expand indefinitely with or without dark energy.
Currently, it looks like the universe is flat. The catch with the above analysis is that, with enough dark energy, it will expand indefinitely no matter what its geometry is. Recent studies show that the universe probably contains that much dark energy.
If the universe continues expanding for a very long time, eventually galactic superclusters will rip apart, followed by local clusters, galaxies themselves and eventually individual stars and atoms. If humanity's descendants are clever about which arrangements of matter they use to instantiate and power themselves, however, they can prolong their existence almost indefinitely. For example, even black holes produce some power through Hawking radiation, which life could cluster around and use to its advantage even if stars have burnt out. Living indefinitely in a continuously expanding universe would be no picnic, but is probably preferable to living in a closed one that collapses back in on itself in a fiery Big Crunch.