Foley rejoined the Mariners last September from Spennymoor Town and scored 66 goals in 132 appearances for the club across two spells.
The 32-year-old released the following statement on the club's website:
“First of all I would like to say what a fantastic club this is.
“Unfortunately my time here has come to an end due to work commitments
“My time with Shields has been very special and I’m glad I have had the opportunity twice to help the club grow while making some lifelong memories along the way.
“Who can forget that incredible season when we won everything there was to win, which I finished by scoring two goals at the famous Wembley Stadium with all my family there and half the town. That day made me very proud to be from South Shields.
“A lot of the faces from my day one are still at the club pushing it forwards and keeping the family feel at Mariners alive, including Gary Crutwell, Bob Scott, Dave Fall, George McLaughlin, Dan Prince and Philip Reay just to mention a few. The work you all do is unbelievable and often goes unnoticed in the hectic matchday routine.
“The club is in magnificent hands in Geoff Thompson and is only going one way, which isn’t going to slow down anytime soon. Thank you Geoff for my time at the club – I’ve enjoyed every second.
“Graham and Lee came 10 years too late for me as a player as they are the best coaches I have had in my career and it has been a pleasure learning from and playing for them both.
“I wish them every success in the future, along with Bri Smith, Phil Naisbett and Andy Morris, who is such a valued member of the set-up inside the changing room.
“I know this club will get to where it wants to be which is the Football League, and I will be cheering from the sidelines for this to happen along with all the fantastic fans.
“I couldn’t leave without saying a huge thank you to each and every one of the Mariners faithful who have supported me from day one along with giving me memories I will cherish forever. The roar I heard at Wembley will always put a smile on my face and I thank you for your constant support.
“Finally to my team-mates, who are more than just team-mates…players come and go in the football world but this group is special.
“I don’t think the brotherhood and friendships you make in football happen in any other job. That will to work for your mate next to you to collectively share the same prize at 5pm on a Saturday is a very unique feeling and one that will be missed.
“I have friends for life in this group and I urge everyone to get behind these players and push them over the line this season.
“Some of the lads in the current squad have been a huge part of why the club is where it is today and I wish every one of them all the best on and off the pitch.
“It has been a pleasure.