That depends. If you itemize deductions for federal income tax purposes, the interest you pay on your mortgage is deductible from your taxable income.
In the early years of a mortgage, nearly all of your payments represent interest and interest is tax deductible. In the final few years, payments consist mostly of principal so the interest is a smaller portion of each payment (and thus your tax savings is reduced). In determining how much you will save on refinancing, don't forget to factor in the increase or decrease in income taxes that may result.