The 42-year-old played in 21 Test matches for England and has taken over 1,000 first-class wickets and also scored more than 10,000 first-class runs for the Welsh county.
Croft will remain with the club in a coaching and ambassadorial role once the season has ended.
The experienced off-spinner praised his former team-mates as his 23-year professional career draws to a close.
"It's finally dawning on me that my career is coming to an end," he said. "I count myself lucky to have played as long as I have and I'm grateful for the support I have received over the years from team-mates, coaches and most importantly from my family and friends.
"I'm also lucky to have played with so many wonderful players for both Glamorgan and England with whom I've shared so many experiences, both good and bad. Those experiences will stay with me."
Glamorgan's chief executive Alan Hamer urged supporters to turn up for Croft's final match at home to Kent next week and is looking forward to seeing the bowler in a coaching capacity.
He said: "Robert's playing record speaks for itself and I hope that large numbers of spectators will attend next week's match against Kent, to give him the send-off he deserves.
"With Robert's playing career drawing to a close, the club have spent the past few weeks working with Robert to determine the most effective way in which his skills and experience can be best utilised.
"We are therefore delighted that Robert will now remain with the Club in a coaching and ambassadorial role which will now not only see him help with the development of our younger players but also working to raise the profile of Glamorgan and Welsh Cricket."