IRS Publication 526
provides an explanation of when you can deduct various charitable contributions:
You can deduct your contributions only in the year you actually make them in cash or other property (or in a succeeding carryover year). This applies whether you use the cash or an accrual method of accounting.
Checks. A check that you mail to a charity is considered delivered on the date you mail it.
Credit card. Contributions charged on your bank credit card are deductible in the year you make the charge.
Pay-by-phone account. If you use a pay-by-phone account, the date you make a contribution is the date the financial institution pays the amount. This date should be shown on the statement the financial institution sends to you.
Stock certificate. The gift to a charity of a properly endorsed stock certificate is completed on the date of mailing or other delivery to the charity or to the charity's agent. However, if you give a stock certificate to your agent or to the issuing corporation for transfer to the name of the charity, your gift is not completed until the date the stock is transferred on the books of the corporation.
Promissory note. If you issue and deliver a promissory note to a charitable organization as a contribution, it is not a contribution until you make the note payments.
Option. If you grant an option to buy real property at a bargain price to a charitable organization, you cannot take a deduction until the organization exercises the option.
Borrowed funds. If you make a contribution with borrowed funds, you can deduct the contribution in the year you make it, regardless of when you repay the loan.
Conditional gift. If your contribution is a conditional gift that depends on a future act or event that may not take place, you cannot take a deduction. But if there is only a negligible chance that the act or event will not take place, you can take a deduction.