As a general rule, if someone forgives a debt that you owe them, the IRS considers that since you don't have to pay the debt, you just made money, and you have to pay taxes on it. But there are a lot of exceptions, including if you file bankruptcy and if you were insolvent at the time the debt was forgiven, at least up to the amount you were insolvent.
Watch Nina Olson, the IRS National Taxpayer Advocate, explain the issue below:
As you can see, it is a complex issue. But, most of my clients do not end up owing the IRS any money by reason of their cancelled debt. If you have other concerns or questions about it, consult your tax advisor. If you don't have one, ask us. We can give you a referral to a tax advisor that is familar with these issues.