After you file

The credit goes on the 2023 return ... the year you took possession.  The fact that you ordered the car in 2022 is immaterial ... you could have cancelled the contract up until you drove it off the lot.