how long do i have to work at a job to get maternity leave?
It comes from the government rather than your employer. You can usually get Maternity Allowance if you've been employed or self-employed for 26 weeks in the 66 weeks before your due date.