Baptism for the dead
Mormonism believes in what is called the baptism for the dead. Although little support for this view is found within the extrabiblical Mormon scriptures (e.g. BoM, D&C, PoGP), LDS typically point to 1 Corinthians 15:29 as evidence. It says, "Now if there is no resurrection, what will those do who are baptized for the dead? If the dead are not raised at all, why are people baptized for them?" Although easily pointed to because of the actual reference to those who "are baptized for the dead", this passage in fact does not support the LDS view. Looking holistically at what the entire Bible says shows that not only is this the only place baptism for the dead is mentioned, but no other passage even implies the view that Mormonism proposes.
 The LDS view
Baptism for the dead is a practice that is performed in the Temple. While there, LDS are baptized on behalf of deceased individuals. These tend to be relatives or even friends, but it is not limited to them. The reason for this baptism stems from the LDS belief salvation after one dies. While in spirit prison or paradise, a person is able to make the right choices in order to help ensure a place within the celestial kingdom. Baptism is an essential ordinance, and so the baptism is performed by those still on earth in hopes that a deceased person will accept the work done for them and be "saved" in the afterlife.
 Problems with this view
A first glance at this view raises the question, "why bother doing any work on this earth if it can be done for you later?" It appears that one can simply choose to accept the atonement in the afterlife, accept a baptism done by someone on earth on their own behalf, accept a marriage for the dead, and one has thus completed a large portion of the necessary work for celestial glory.
However, LDS have replied that their scriptures do not support this view. Those who accept the atonement and its work in the afterlife are not granted the same degree of glory as those who accept it and persevere while on this earth.
 See also
- Did Jesus Establish Baptism for The Dead? (IRR)
- What is Baptism for the Dead Mentioned in 1 Cor. 15:29? (carm.org)