UK tax withholding (PAYE) is normally calculated on a cumulative basis. If April is month 1, May month 2, etc, then the cumulative tax allowance you have in month n is n/12 times the annual personal allowance. If your pay periods aren't months, the same logic applies but it'll be n/52 for the nth week of the year, etc.
In each month, your employer should then look at the amount you've earned year to date, compare it with the cumulative tax allowance, and work out how much tax you should have paid so far this year. They then look at the tax you had paid up till the previous month and subtract that, to tell them the tax you should pay for this month. So in practice with the cumulative basis, you ought to get the benefit of any unused tax allowance in the year to date.
However, in your case you have a "non-cumulative" tax code, signified by the 'M1' at the end. This is probably because you declared a previous job but didn't provide your new employer with a P45 they could use to calculate your cumulative tax properly. With the non-cumulative tax code, they just give you 1/12th of the allowance each month, i.e. they end up working out the tax as if you are getting the same salary for the whole year.
Two things you can try to do now:
- Get a P45 from your previous employer. By law they should give you one.
- Contact HMRC, explain the situation, and ask their advice. Perhaps they'll help you chase up the P45, or maybe they can send an updated tax code to your current employer. In principle they ought to have the details of your previous job and be able to work out a tax code that will result in the right withholding, at least by the end of the year.
If the situation doesn't get resolved before, then you should be able to contact HMRC at the end of the tax year to organise a refund. B.Liu pointed out in a comment that if you don't contact them they ought to send you a P800 assessment anyway by the end of November 2020 to sort it out.
For next tax year, you should automatically reset to a standard cumulative tax code, and you will get your salary withheld as if you would be working all year. Once you stop work, you can claim back the overpaid tax using a P50 form. If you stop work because you are leaving the country, you can use form P85.
You can also check HMRC's view of your tax at this page, once you're setup for online access.