I don't know if this is the truth but I've read somewhere that our sun will become a supernova in about about a million years or so. That will probably be it for Earth.
When will humanity end? Seeing how we are the dominant species on the planet, we're not going anywhere. Unless we will make a stupid mistake and start a world war (which with time becomes less likely, there are just smaller, 2-3 nation conflicts). Sure, we're draining natural resources but sooner or later (probably later

we will develop technology advanced enough to make everything affordable to everybody. There's a chance that it won't happen, even in the next few centuries, but we will eventually do it.
Over the course of, let's say 100000 years, we we will evolve into different beings than we are now, the things we will create by then will make us look like gods in the eyes of a person from the 21st century. By that time, we will probably have many planets colonized. Life will evolve differently on each planet, creating many new intelligent species.
... and so on.
That's how I see it.
I hope you've enjoyed that.