You have until April 18th, 2017 to contribute to an IRA and claim the deduction for 2016, but you need to tell the financial institution which year you are applying the contribution to.
In other words, contributions made between January 1, 2017 and April 18th, 2017 can be applied to 2016 or 2017, but only to one of the years.
You can take the deduction on your 2016 tax year return even before you make the contribution, but in order to avoid penalties and interest, you must not forget to make the contribution before "tax day" (this year April 18th, 2017). Tell the account trustee which year you are applying the contribution to so that the report they send to the IRS is accurate.