It's mandated before first payroll for any W-2 employer. There are additional reasons though:
1. If the employer is doing a credit check, they are allowed by federal law to ask for it.
2. If the employer must use the SSN to verify non-public license, work eligibility, or other regulatory information (discipline, etc.), they are allowed by federal law to ask for it.
3. Healthcare is a "protected industry" under federal law, so they can ask for it period due that reason.
If you are going to work for McDonald's, it's 1 or 2. 3 is the reason for a pharmacist requirement, but 1 and 2 are also in play.