The 27-year-old joins the Super Lig side just a year after signing for the Hammers from Valencia on a three-season deal.
Feghouli has signed a five-year contract with Galatasaray and is their seventh signing of a productive transfer window.
"West Ham United would like to thank Sofiane for his efforts and wish him well in his future career," the Premier League club said in a statement.
Feghouli's exit comes amid reports that West Ham are closing in on a club-record $A49.5 million deal for William Carvalho.
The Portugal international was left out of Sporting CP's squad for their Champions League play-off first leg with FCSB on Wednesday (AEST).