It depends. In the questions below, note that what is important is the date on which any coverage started. The coverage that you had on the first day of the month determines the coverage for the entire month. For example, if you began Medicare on December 2, 2018, you were not covered by Medicare that month but were covered by whatever insurance you had on the first day of the month.
1. Were you covered by a High Deductible Health Plan (HDHP) from January 2018 to November 2018?
2. Did you have Self-only or Family coverage in those months?
3. In 2018, the Self-only annual limit was $3,450 and the Family annual limit was $6,900.
4. If you were covered by Medicare on December 1, 2018 but had HDHP coverage for each month before that date, then to calculate the limit, you multiply the appropriate annual limit in line #3 by (number of months covered by HDHP divided by 12). (NOTE: if you were not covered by Medicare on December 1, 2018, then you use the full annual HSA contribution limit)
5. Have you already made any HSA contributions in 2018? If so, the amount you gave during the year PLUS the amount you are planning to give in 2019 for 2018 must be at or under the limit in #4.
P.S., when you make the contribution in 2019 for 2018, you must make sure that the HSA custodian understands that the contribution is for 2018, because their default would be to make it for the current year (2019).