法律的には2週間前で可
就業規則で何ヶ月以上前にとの記載があっても民法が優先されるため無効

https://hataraquest.com/labor-standards-law-retirement#128211