The 25-year-old centre-back will complete the season with Porto, where he has played since 2010, before moving to Spain and the Mestalla on a five-year contract.
Otamendi told Valencia's official website: "After playing for a club like Porto - a huge, prestigious club - it is an honour to join a club like Valencia for the next stage of my career.
"Valencia are one of the most historic and attractive teams in Spain and in Europe, and I am very happy with this next step in my footballing life."
Capped 16 times for Argentina, Otamendi has won three league titles, the Portuguese Cup and the Europa League with Porto.
Valencia have struggled in the Primera Division this season and sit eighth in the table. They did, however, beat Spanish champions Barcelona at the Nou Camp on Saturday.
Valencia sporting manager Francisco Rufete said: "We have a great squad and we are convinced that Nico Otamendi will help us to improve from next season onwards, because he is a world-class talent.
"He is a strategic incorporation for our project and we are fortunate that he has chosen Valencia out of the many clubs vying for his signature.
"The arrival of Otamendi is great news for all Valencianistas and for the future of our side."