The world? Probably either when our orbit decays and we fall into the sun, or the sun takes us out with either a solar flare or going nova. In either case, we're probably talking in the multi-billion year range (hopefully.)
Humans? Less. Probably much less. Our means of killing one another are getting better while our planet is growing less capable of sustaining our ever-growing population. I would be pleasantly surprised if we weren't knocked back to hunter-gatherer levels within three centuries, and continued to decline from there. Even if we don't nuke or bio-weapon ourselves, we're more than due for a Black Plague-level epidemic, and only slightly better equipped to handle one.