Marler made his Quins debut in 2009-10 and was part of the squad that won the 2011-12 Premiership title, where he started in the 25-23 semi-final win over Northampton Saints and the 30-23 final victory over Leicester Tigers at Twickenham.
He played 18 times in the club’s run to their second league title, starting in the epic 40-38 final victory over Exeter Chiefs at the national stadium.
The Quins legend has made two appearances so far this season and is in line to play his last professional match against Bristol on Friday.
“The most important thing I want to say to our fantastic supporters is thank you,” he said.
“Thank you for your patience and support, when you could easily have turned your back on me.
“For the kindness you’ve shown, even when I haven’t deserved it, and for cheering my name, even after I’d been banned again.”
News of Marler’s retirement comes amid a flurry of contract extensions announced at Harlequins during the autumn international break.
Vice captain Cadan Murley, scrum-half Will Porter, winger Cassius Cleaves, full-back Tyrone Green, flanker Will Evans and hooker Sam Riley have all committed their futures to the club in the past two weeks.