You can generally include medical expenses you pay for yourself, as well as those you pay for someone who was your spouse or your dependent either when the services were provided or when you paid for them. There are different rules for decedents and for individuals who are the subject of multiple support agreements.
For more information see IRS Publication 17 Your Federal Income Tax (For Individuals).