Health Savings Accounts (HSAs) allow you to set aside part of your paycheck on a pretax basis, so you can use that money to pay for certain medical expenses at a later date. But HSAs aren't available for everyone.
Under a provision called the Last-Month Rule, if you are covered under an HDHP anytime up to the first day of the last month of the tax year (typically, December 1), you are eligible to make a contribution to an HSA. But if you don't become covered under an HDHP until some time after that first day of the last month (in our example, December 15), you'd be ineligible to contribute to an HSA for 2017.
Further, the Last-Month Rule has a testing period that runs from December 1 of the current year through December 31 of the next year. If you don't remain eligible to contribute to an HSA for that entire period—say you end your HDHP coverage at some point during the year—any excess contributions made to the HSA would incur taxes, as well as a 10-percent penalty.
Also, if you are claimed as a dependent on someone else's tax return, you are not eligible to make contributions to an HSA.
For more details, see IRS Publication 969: Health Savings Accounts and Other Tax-Favored Health Plans