When you buy a house, you get to deduct in one fell swoop the points paid to get your mortgage.
When you refinance, though, you have to deduct the points on the new loan over the life of that loan. That means you can deduct 1/30th of the points a year if it's a 30-year mortgage. That's $33 a year for each $1,000 of points you paid—not much, maybe, but don't throw it away.
Even more important, in the year you pay off the loan—because you sell the house or refinance again—you get to deduct all as-yet-undeducted points. There's one exception to this sweet rule: If you refinance a refinanced loan with the same lender, you add the points paid on the latest deal to the leftovers from the previous refinancing, then deduct that amount gradually over the life of the new loan. A pain? Yes, but at least you'll be compensated for the hassle.