Qualifying medical expenses may get you some extra cash back at tax time if you itemize your deductions and write off the costs. However, the Internal Revenue Service has rules about the tax year in which you can write off your doctor's bills. Knowing them ahead of time can help you maximize your deductions.

Deduction Timing

The year in which you take a deduction for medical expenses depends on the year in which you pay the costs -- not the year you incur the costs. For example, say that you have surgery on Dec. 20, 2013, but don't pay the bill until Jan. 5, 2014. Those medical costs are deductible on your 2014 tax return, not on your 2013 return. If the dates were flipped -- you paid in December 2013 and had the operation in January 2014 -- you could only deduct those costs on your 2013 return.

Qualifying Costs

Medical expenses include costs you paid out of pocket for preventive care, diagnosis, treatments and prescription drugs. The only nonprescription drug included as a qualifying cost is insulin. Any costs paid by insurance or reimbursed to you aren't deductible; the costs you pay for your own care are deductible. You can also count costs you pay for someone who is either your spouse or your dependent either at the time the services were provided or the time you paid the bill.

Deduction Limitations

The medical expenses deduction is an itemized deduction, which means you can't claim it unless you give up your standard deduction and itemize. Plus, the medical expenses deduction isn't a dollar-for-dollar deduction. Instead, you can only deduct the portion of your medical expenses in excess of 10 percent of your adjusted gross income, or AGI. For example, if you have an AGI of $60,000, the first $6,000 of your medical expenses isn't deductible. If you have $7,500 in medical expenses, you could only write off $1,500.

Amending Prior Returns

If you missed out on a deduction for medical expenses in past years for any reason, even simply not knowing about the deduction, you can file an amended return for the prior three years. Filing an amended return requires completing Form 1040X to claim your additional deduction. You can't simply add those unclaimed expenses to your deduction for the current year, however.