It's for the applicable year of the contribution, meaning the current year of the prior year if you're making a contribution before April 15th to be applied to the prior year.
If, when you file your 2022 taxes next year, you end up over the contribution limit, you have several options to avoid penalties. You can withdraw the excess amount (and any associated earnings) before you file your taxes (or later, but you must file an amended return), you can apply the overcontribution to the next tax year, or you can rollrecharacterize the excess over tointo a Traditional IRA.