Retirement tax questions

Yes.  Pay counts when you are paid, not when it is earned.  If you got a check in 2024, you will get a W-2 for 2024, and if you had 401k participation on your 2024 check, your W-4 will indicate that you are a participant for 2024.