You can give to a charity whenever you are able and willing to make a donation. However, for tax purposes, if you want the contribution to be tax-deductible in a given year you must make the donation by the end of the tax year.
A contribution is deductible in the year in which it is paid or submitted for delivery. Dating a check for the last day of the year and then sending the check the beginning of the following year does not constitute payment in the intended tax year. However, putting the check in the mail to the charity by the end of the tax year constitutes payment even if the charity does not cash the check or even receive the check until the next tax year.
Likewise, a contribution made on a credit card is deductible in the year it is charged to your credit card, even if payment to the credit card company is made in a later year.