Yes, you can leave Thailand and stay in the UK for 5 months on a Retirement visa with a valid re-entry permit. There is no specific limit on how long you can stay out of the country as long as you return before your re-entry permit or visa extension expires.
NON-O RETIREMENT VISA RESOURCES / SERVICES
Go to the Retirement Visa Section for information on requirements, including age restrictions, financial requirements, and necessary documentation.
For immediate assistance, contact Thai Visa Centre directly via LINE at @ThaiVisaCentre or Email them.
Explore recent discussions by using the Non-O Retirement Visa tag in the search box at the top of the page.
If you have a year extension and a valid re-entry permit there is no set amount of time you need to spend in country.
As long as you'd come back before your current extension/re-entry expires so you could apply for a new yearly extension you're fine to stay out as long as you want.
The ask:thailand community, consisting of multiple Q/A groups with over 100,000 members, powers this platform. It is not an official government resource. Our members actively contribute to this resource, and while we strive for accuracy, we cannot guarantee its complete reliability. Assistance to travelers is provided as a community service.