Afterlife usually refers to "life after death", "eternal life", or something of the like of the soul. The soul is believed to be the spiritual part of the body that, as stated above, will live forever in the afterlife. The painful truth is that people sometimes feel deep-down that when they die, they are gone forever. Therefore, they make up things like an afterlife as a form of willful ignorance so that they don't have to think about their ultimate fate.
The trouble is once they have made something up their imagination can run riot. In the end people can imagine an afterlife that is far worse than annihilation. See The Christian concept of Hell. Belief in an afterlife can in cause more pain than atheists experience when they know they will end at death.
Purgatory is the line in between, because there is always something in between.
However, some Christian sects believe in forms of afterlife that are more compatible with naturalism, materialism, and even property dualism, all of which have the consequence that the mind dies with the body. The Jehovah's Witnesses and various other sects believe that when you die, you are knocked out until when God decides to resurrect you, if he ever does. Christian mortalism (Wikipedia) lists several notable advocates of this viewpoint, sometimes called "soul sleep".
Hindus and some Buddhists believe that the soul is reincarnated into another person or animal (incidentally, people don't get reincarnated into plants, fungi, bacteria, protists, or abiotic objects). They believe this cycle will continue, until you've proven yourself worthy of Nirvana. In this case, you'll lose your memory every time, until Nirvana.
Some people believe in ghosts, which are the souls of people who are on earth, either because they have chosen this way, or they have unfinished business. This means that Earth is Heaven and Hell at the same time.
A common "theoretical justification" for the afterlife is substance mind-body dualism or the separable-soul hypothesis. The mind and perhaps some additional essence lives in the body, and this entity departs from the body when the body is no longer a suitable host for it.
Partially copied from RationalWiki