Cape-Town born Thomas, 38, arrived at Taunton ahead of the 2008 campaign.
In total he played in 91 first-class matches scoring 1,852 runs and taking 306 wickets, including a haul of more than 100 in the summer of 2010.
"It's been great fun but like all good things they eventually come to an end," said Thomas.
"I'm intending to remain in cricket - either continuing to play or by making the transition into coaching - it was a great privilege to be asked by Gary Kirsten to work with his bowlers during the IPL (Indian Premier League) in India this year that I really enjoyed."
Media playback is not supported on this device
Thomas, who played one Twenty20 international for South Africa in February 2007, had a short spell with Warwickshire before signing for Somerset and has had forged a reputation as an influential T20 performer.
He has won T20 tournaments across the world in South Africa, Australia and Bangladesh and has competed in the IPL for two years.
In 2013, he became the highest T20 wicket-taker in the world and is currently fourth in the list, having taken a total of 263 in his career.
Last season, Thomas took a club-record four wickets in four balls in a County Championship match against Sussex.
The South African led Somerset on numerous occasions in Marcus Trescothick's absence, most memorably during Somerset's run in the Champions League T20 in 2011 when they reached the semi-final stage.
"Alfonso has proved himself to be one of the best bowlers in one-day cricket - particularly in high pressure situations - where he has proved himself to be world class time and time again," said Somerset director of cricket Matt Maynard.
"Alfonso's contribution to Somerset has been immense over many years and I am sure I can speak for all Somerset supporters in extending their thanks and best wishes to Alfonso and his family for the future."
Somerset fast bowler Alfonso Thomas, who has taken over 550 wickets for the county, will be leaving the club at the end of the season.