In general debt forgiven is counted as income on your income tax return. You will receive a 1099-C Cancellation of Debt, for the amount of debt forgiven. People who have large credit card debts forgiven find out that they can have significant tax bills when they file their taxes. Have a charge card debt cancelled and you will receive a 1099-C and owe tax on the amount canceled.
Under the Mortgage Debt Relief Act of 2007 discharge of debt (for your principle residence) due to mortgage loan restructuring or mortgage debt forgiven in connection with foreclosure can be excluded from income. This only applies to mortgage debt forgiven between 2007 and 2012.
Also, debts cancelled because of bankruptcy or insolvency are usually not taxable.