Theoretically, the Earth only has roughly another 1.75 billion years in which it will support life. However, humans are closer to wiping life off the planet themselves without the help of universal intervention.
We, as humans, develop a false sense of security when it comes to the mortality of our own race. I mean, can you blame us? Thinking about how the Earth will end most likely because of our own doing (not everyone, we're pointing fingers at the eight major companies that produce more than 80% of the Earth's pollution), but if it doesn't, then there are only a few things that we'd have to worry about as a species.
The Earth is most likely going to meet its life-demise via major natural disasters, famine, plague, an asteroid, and most likely, a nuclear holocaust. But, the Earth will likely still exist in a habitable manner (provided we don't ruin that too) for quite a long while after humans go extinct.
The Earth is in a very small solar window that allows life to exist and thrive on its surface. The Earth is not unique to all planets in the universe, as a matter of fact, it is assumed that 20-50% of all solar systems also have planets that orbit in their "habitable zone."
But, in 1.75-3.25 billion years from now, the Earth will orbit out of the habitable zone into the "hot zone." Experiencing this galactic warm-up will evaporate all water on the planet, subsequently killing all oxygen-producing life and rendering the Earth a dead-zone.
However, it is assumed that with the advancement of technology, human beings will likely not only exist in physical forms. Hypothetically, humankind will advance past the need to have physical bodies, and we will ideally simply upload our consciousnesses into a data cloud where we will live forever in spirit. That, however, has yet to be conquered yet.