The 39-year-old has revitalised the Adams Park side since being handed the job in November, hauling them from the foot of the Football League to a comfortable mid-table finish.
The winger has pulled on his boots on 19 occasions since taking up the reins but this weekend's match against his former club, his 600th in professional football should he make an appearance, will be his last.
"I'm really, really pleased," he told the club's official website. "I'm honoured, proud and very, very thankful to everyone that has supported me in any way that they have. Everyone has been behind me since day one.
"This is enormous for me and I'm really thankful to everyone who has helped me achieve this. I want to repay the Trust and all the supporters by working so hard and bringing back the glory years. I'll give it my best shot, I promise you.
"The hardest part is making that decision (to retire). Football has been my life for all these years - it's all I've ever done and ever known. I've spoken to people who are close to me and everyone seems to think it's the right thing to do - it's better to go out on a high.
"Thank you to everyone who has ever shouted for me at every club I've played for. It's been a rollercoaster but I wouldn't change any minute of it for anything."
Joint-chairman Don Woodward added: "It's great to secure Gareth's services and we are really looking forward to continuing to work with a young but passionate manager.
"We are very excited to have a natural leader and a great guy managing our football club, hopefully onwards and upwards."