Hi Neil Wilts,
The code will collect the correct tax based on your income for the tax year.
Once you leave your current job if you then start a new job you would hand in your P45 and any refund would be calculated through your new employer.
If you are not returning to employment or receiving taxable benefit then you can complete a P50 from to claim a refund, please see tha following link,
Claim back Income Tax when you've stopped working (P50).
Thank you.