This, purgetory,is similar to one form of hell in Judaism.
Just for the sake of further clarification: the purgatory-analogue, Gehinnom, is by far and away the most widespread of such beliefs in Judaism, though of course it is not binding dogma-- we are not all
required to believe in Gehinnom. And even Gehinnom is a late Second Temple Period innovation, completely absent from Biblical Judaism. Other, more rigorous concepts of Hell also seem to have been bruited about in the late Second Temple Period, but none of these made it into Rabbinic Judaism.
We believe that after death, the soul remains with the body, remembering and regretting one's sins, for a period up to but not exceeding one year. That is why we traditionally wait a year before laying the headstone. A year might not seem like much, but without sleep or other distractions, and perfect recollection, it would seem like eternity. It's believed that this process takes a lot less than a year for the average person, a saint a very short time but for an evil person perhaps the entire year.
Actually, this is the span of time in which those who have believed in Gehinnom say is the duration of one's sentence there. This is not only where the headstone custom arose from, but also where the custom of saying Kaddish for eleven months arose. The interpretation of this as time the souls spends with the body introspecting is actually a Kabbalistic notion that postdates the establishment of these customs based on beliefs about Gehinnom. Granted, I certainly prefer the Kabbalistic interpretation, but it's only fair to note that this was a later innovation.
Then there is Final Judgment, where one might find oneself damned. However in this case there is no hell, but total and eternal destruction of the soul which is damned.
There is even less agreement about this notion than about the existence of Gehinnom at all. Many have not believed in a literal Final Judgment at all, and of those who do, the majority have indicated that one who has arrived at the Final Judgment without yet having worked off all his sins will be punished accordingly in Gehinnom, or in exile from the World To Come. Fewer have indicated the punishment being a complete unmaking of the soul-- though, I grant you, those who have said so include some brilliant and monumental rabbis.