I remember reading a novel that said you stay in the afterlife as long as any living person knew you personally, but then a global plague starts killing everyone
The last people in the afterlife were the personal friends of a science team that had been stationed in Antarctica.