In the early days of Christianity, people pretty much thought that at the Last Judgment you went to Heaven if you had been good or you went to Hell if you had been bad and that was that. This was about the same as the old Egyptian idea of the weighing of the souls.
But later on more people became Christians, and some of them weren’t such serious people, and they sometimes did things that were wrong. Maybe they stole some candy, or they cheated on their girlfriend. Maybe they lied about being Christians in order to keep from getting killed by the Romans. These people started to say, well, what if you had been mostly good except for one thing? Would you really have to stay in Hell forever just for that one thing? And beginning with Augustine, Christian writers began to form the idea of Purgatory, which was a bad place, like Hell.
You went to Purgatory after the Last Judgment, at the end of time, if you had done some bad things but you were mostly good. And you paid for the bad things, but then after a while you could still go on to Heaven. This is not far from the Buddhist idea that people are reincarnated over and over until they are good enough to be released from the wheel. Pope Gregory the Great first clearly laid out the idea of Purgatory around 580 AD.
Then Purgatory got a lot more attention from the Italian poet Dante in the early 1300s AD. But Dante made it seem like people went immediately to Heaven or Hell, or to Purgatory, as soon as they died. He didn’t emphasize how they had to wait for the Last Judgment. So since the Middle Ages, most Christians actually tend to think that their relatives who have died are already up in Heaven watching over them, or in Purgatory.