You must keep your records for at least 5 years after the 31st January submission deadline of the relevant tax year. For example if you sent your 2016-17 tax return online by 31st January 2018 you must keep your records until at least the end of 2023.
But if you send your tax return more than 4 years after the deadline, you’ll need to keep your records for 15 months after you send your tax return.