Villa said on his new club's website, nycfc.com: "Throughout my career I've always tried to keep pushing myself to achieve new targets and this represents another important goal for me.
"It's a real honour that the people who have formed the club have focused their attention on me. I'm keen to do the best I can, take on board that extra responsibility and prove my worth by repaying the confidence they have shown in me."
New York City sporting director Claudio Reyna said: "David is the perfect first signing for New York City FC. His individual accomplishments are remarkable.
"His experiences, including winning the 2010 World Cup, will be invaluable for building our club's sporting culture. I couldn't be more excited to welcome him to New York City and have him as our club's first player."
For the big stories and the banter follow us on Twitter: @tribalfootball