Moreton was only appointed as the school's headteacher last year following the retirement of John Barrett.
In a letter to parents, he said: "I have taken the very difficult decision to resign as Malmesbury School’s headteacher at the end of this academic year in August.
"This decision has not been an easy one for me to make as I have really enjoyed working at the school and with our students, staff, parents and carers.
"Malmesbury School is truly a very special community.
"I have decided that after a few challenging years, compounded by taking two different schools through the global pandemic, I would like some time away from teaching to recharge and reset.
"I wish you all the very best for the future and thank you for the support you have shown me."
Moreton was previously head of Cheney School in Oxford before he took over the role at Malmesbury School.