When a person decides to file for bankruptcy, they can eliminate their liability on most debts (this article only refers to dischargeable debts, not certain types of debts that cannot be eliminated by bankruptcy).
Quite often when people go into a Chapter 7 bankruptcy, they want to "keep a debt out of bankruptcy," and hold on to their property, even though they are still making payments on the property. This can be accomplished through what is called a "reaffirmation agreement," and it is permitted by the U.S. Bankruptcy Code.
However, just because something is permitted by the Code does not mean that it is a good idea for people to reaffirm debts. A reaffirmation agreement essentially means that the bankruptcy never happened as to the debt: in other words, the creditor can still sue a person for the debt, and the person still owes the entire balance to the creditor. So, if you go through a Chapter 7 case, and fall behind on a reaffirmed debt, the property can be repossessed, and the creditor has the right to come after the consumer for the remaining balance.
There are time limits and requirements for being able to file a reaffirmation agreement, which can be found in 11 U.S.C. 524. The U.S. Courts also have a cover sheet form, form 27, available for review online. It is important for people to closely review any reaffirmation agreements with their attorney. Depending on the situation, it may also be necessary for the debtor to actually appear in front of the bankruptcy judge, who may refuse to approve the reaffirmation agreement.
A reaffirmation agreement may be appropriate in some situations, but people should be very careful when considering whether to reaffirm a debt.
On a side note, even though the Code doesn't expressly allow it, people
often just continue to pay for a particular car or home, and the
creditor will not require a reaffirmation agreement. In my experience, this most often happens with real estate; most financial institutions require reaffirmation agreements for vehicle loans.