Generally speaking, an applicant gets two shots of the recruiting test, with a gap of 12 months in-between.
Exceptionally, after a first attempt failure, if the individual is in full-time education, the Area Recruiting Manager may grant permission for a re-take in 6 months if there is evidence (letter from tutor or teacher to confirm full time academic attendance).
After a second fail, a third attempt can only be made in
exceptional circumstances at the discretion
of the Reginal Recruiting Officer. A minimum of at least twelve months must have elapsed between the
second and third attempts.
Exceptional means outstanding circumstances unique to the individual indicating a significant change in circumstances, rather than the fact they've waited a year since the last fail.
The rules are here, Chapter 15, article 1507:
http://www.royalnavy.mod.uk/News-an.../~/media/Files/Navy-PDFs/BR3/br3book/ch15.pdf