The 33-year-old, the son of former Hammers and England defender Alvin Martin, has agreed a two-year contract.
“Signing for West Ham United is a dream, both for me and my family,” Martin told the club website.
“I’ve grown up around West Ham and to come to my boyhood club is a dream.”
Martin is likely to be West Ham’s third-choice keeper behind fellow summer signing Roberto and player of the year Lukasz Fabianski.
Meanwhile, West Ham’s Swiss midfielder Edimilson Fernandes has joined Bundesliga club Mainz for an undisclosed fee.
Fernandes, 23, made 48 appearances across his first two seasons with the Hammers and spent last term on loan in Italy with Fiorentina.