A section 3 patient can be taken back into detention until their section is due to expire or six months from the day they went AWOL (whichever is longer). See section 18 of the MHA.
What happens if the patient returns or is brought back to the hospital during that time is set out in sections 21, 21A and 21B of the Act. In short, the responsible clinician will always have at least seven days to examne them and decide whether to renew their section (if necessary). If they’ve been away for more than 28 days, the responsible clinician must make a report to the managers within seven days confirming the patient stil meets the criteria for continued detention (otherwise the patient’s section ends automatically).
The rules are explained in chapter 25 of the MHA Reference Guide (paras 25.21 onwards)