Hi j.s.
You can apply for ‘new style’ ESA up to 3 months before your SSP ends. You’ll start getting ‘new style’ ESA as soon as your SSP ends.
www.gov.uk/employment-support-allowance/eligibility If you’re not eligible or your SSP ends;
www.gov.uk/statutory-sick-pay/eligibility You may be able to apply for Universal Credit or Employment and Support Allowance (ESA). You can use form SSP1 to support your application.
If your SSP is ending your employer must send you form SSP1 either:
within 7 days of your SSP ending, if it ends unexpectedly while you’re still sick
on or before the beginning of the 23rd week, if your SSP is expected to end before your sickness does.
If you do not qualify for SSP your employer must send you form SSP1 within 7 days of you going off sick.
Gary