There are several far-distant events that could cause the death of our planet or solar system. For instance, Gliese 710 will be only 1.1 Light years from Earth in 1.4 million years, and might catastrophically perturb the Oort cloud. In about 3 billion years, the Andromeda Galaxy is expected to collide with our Milky Way galaxy. In 5 billion years the Sun's stellar evolution will reach the red giant stage, in which it will expand to engulf the Earth. Before this date, its radiated spectrum may alter in ways Earth-bound humans could not survive.
There are also theories about the life of Universe that may be finite. In the very long term the ultimate threat to humanity may be entropy, with the postulated heat death of the universe predicted by the second law of thermodynamics.
Until fairly recent times, even the scientific view of the Universe was one of eternal and unchanging existence. After Edwin Hubble's discovery of an expanding Universe, suddenly the notion of a start and, possibly, an end, was the subject of scientific investigation.
Theories can be divided into three major groups:
that, despite the observation, the Universe is eternal as believed before: steady-state Universe and oscillatory Universe.
that the Universe had a beginning, but not a clear-cut end: heat-death of the Universe and the Big Rip
that the Universe had a beginning, and will end in some way: Big Crunch
The first group is not discussed in this article, since it negates the very end of the Universe. In these theories, some kind of meaningful activity can last forever.
All theories must come to terms with general relativity, which provides a common background for cosmological speculation. Most of these theories are solutions of GR equations, only changing parameters like average density, cosmological constant, etc.
Infinite time, but finite lifespan
In an open Universe, General Relativity shows that the Universe can exist indefinitely in the future, but will settle down into a state where life as we know it will cease to exist.
In 2003, New Scientist magazine reported a preprint by Robert R. Caldwell, Marc Kamionkowski and Nevin N. Weinberg which puts forward the hypothesis that the end of the Universe may occur as a "Big Rip", which will shred the physical structure of the Universe.
In this model, a cosmological constant causes the Universe's rate of expansion to accelerate. Taken to the extreme, an ever-accelerating expansion means that all physical objects in the Universe, starting with galaxies and down to individual human beings, bacteria, and grains of sand, will eventually be torn to pieces and then to elementary particles. The Universe will be then reduced to single elementary particles forever accelerating away from one other.
Finite time and lifespan
The Big Crunch theory postulates that the average density of the Universe is enough to stop its expansion and begin a cosm-wide contraction; a counterpart to the Big Bang.
It is unclear what the end result would be: a simple extrapolation would have all the matter and space-time in the Universe collapse into a dimensionless singularity, but at these scales quantum effects, ignored by General Relativity, should be considered. Some people use this opportunity to postulate an oscillatory Universe, that starts again to expand.
However, recent experimental evidence (namely the observation of distant supernovae as standard candles, and the well-resolved mapping of the cosmic microwave background) have - to most scientists' considerable surprise - shown that the expansion of the universe is not being slowed down by gravity, but instead, accelerating, suggesting that the universe will not end with a "Big Crunch", but will instead expand forever.
In the framework of the field equations of the General Theory of Relativity, the simplest model of an accelerating expansion corresponds to a positive value of the cosmological constant, which is often attributed to the quantum vacuum itself exerting a negative pressure that repels gravitationally on large scales. More generally, the accelerating expansion is attributed to dark energy, which could be the cosmological constant, or a dynamical field with negative pressure, leading to an effective cosmological constant that could be time-varying. In such cases, it is theoretically possible that the cosmological constant need not remain positive, leaving open the possibility of a Big Crunch in a cosmic doomsday scenario. A Big Crunch is also still theoretically possible if Einstein's theory of general relativity turns out to be incorrect on large scales. The current evidence neither favors nor rules out dark energy, or modifications of general relativity, of a form that could halt or reverse an eternal expansion; it does, however set lower bounds on the soonest the universe could collapse (~ 42 billion years from now, or more than 24 billion years at the 95% confidence level, according to one group led by Andrei Linde).
Some well-known physicists have speculated that an advanced civilization could use a finite amount of energy to survive for an effectively infinite amount of time. The strategy is to have brief periods of activity, alternated by longer and longer periods of hibernation (see Dyson's eternal intelligence for more information).
The reverse is true for a civilization finding itself in the middle of the Big Crunch. Here, an effectively infinite amount of subjective time can be extracted from the finite remaining time, using the enormous energy of the Crunch to "speed up" life faster than the limit is approaching. (see Frank J. Tipler's Omega point)
Even if possible in theory, it is not clear if a practical way to use those possibilities can be developed by any civilization, as advanced as it may be.