In a few billion years or so. Because, according to this site, “the slim chance our planet will survive when the Sun begins its death throes has been ruled out.” Some scientists thought maybe earth would pull through, but then they put together a really detailed model and realized, no, our planet will perish after inducing something called a “tidal bulge” (heh!) on the surface of the sun. “There is one last hope for anybody still living on Earth, the researchers say. In the past, some have suggested that Earth’s orbit could be tweaked by arranging the fly-by of a nearby asteroid to tug at it.”
Should there be any humans left, let’s hope a brave crew of multi-ethnic experts can be assembled and sent into the heart of space to carry out such a mission, without succumbing to the psychological horrors associated with that journey.