"Walter is a very attacking full-back who can get forward," caretaker manager Kevin Keen told the club's website.
Lopez said he watched the Premier League "all the time" and was "very happy (to) get to play for West Ham".
He is West Ham's fourth signing of the summer, joining Valon Behrami, Balint Bajner and loanee Jan Lastuvka.
"I am really happy to be here and I hope to have a good career," Lopez added on the club's official website.
"Upton Park is a beautiful stadium and it will be great to play for West Ham. I am looking forward to it.
"It is a great club and there are some great players at the club. I know about many of them like Lucas Neill and Craig Bellamy. Everyone here has made me feel very welcome."