Afterlife was a term referring to any kind of continued existence after one's death.
Ferengi tradition told that all life profit and loss statements were weighted. Worthy traders were sent to the Divine Treasury, the others to the Vault of Eternal Destitution. (DS9: "Little Green Men")
Some Humans believed that a person would be sent to a different afterlife, either Heaven or Hell, depending on their actions in life. (TOS: "Space Seed") In 2365, Captain Picard explained that there were two contemporary philosophies on afterlife. One was the belief that death was the transformation into an indestructible and unchanging form. The purpose of the entire universe was to then maintain that form in an Garden of Eden-like place. The other was that death was simply blinking into nothingness. Picard himself believed that the existence of lifeforms was part of a reality beyond what was currently understood as reality and therefore both philosophies were insufficient. (TNG: "Where Silence Has Lease")
Many cultures believed that people would exist in the afterlife in a "pure" physical state, cured of health issues from their previous life. In 2368, when Geordi La Forge and Ro Laren were thrown out of phase by a transporter accident and declared dead by a crew that could not see them, the blind La Forge regarded the continued function of his VISOR as proof that, contrary to what Ro believed, they were still alive. (TNG: "The Next Phase")
In 2375, Julian Bashir and Miles O'Brien were near death while exploring the mind of Luther Sloan Seeing a light appear in a certain corridor, O'Brien suggested it was the tunnel to the Great Beyond. (DS9: "Extreme Measures")
A species of non-corporeal lifeforms who fed on the consciousness of corporeal beings used a Matrix to trap minds of people who were close to death. The aliens needed the person to enter the Matrix voluntarily, so they claimed it was the afterlife. (VOY: "Coda")
Klingon mythology taught that honorable warriors were sent to Sto-vo-kor when they die, while dishonorable ones were sent to Gre'thor. B'Elanna Torres experienced being sent to Gre'thor to save her mother from dishonor. (VOY: "Barge of the Dead")
Talaxians mythology had a belief in an afterlife known as the Great Forest, in which a great tree stood at the center. It was said that upon death, a Talaxian went to the afterlife and met the souls of their deceased family upon arrival. (VOY: "Mortal Coil")