The Portuguese midfielder had a year left on his contract at Upton Park but the club have agreed to cancel the deal early.
The former Fulham winger, who joined the Hammers in 2007, has confirmed that he will be joining a club abroad.
"I am sad to leave West Ham as I have made a lot friends here. It is also a sad day for me to leave playing football in England after 14 years," Boa Morte told the club's official website.
"I am looking forward to a new challenge. It is never too late to try somewhere and something different. There are high and low memories - the low ones only make you stronger - now it is a fresh start for me."
Boa Morte, 33, has also represented Arsenal and Southampton during his time in England.