Villa have paid a £5.2m buyout fee to Villarreal for the 50-year-old.
Emery, who would have been out of contract at Villarreal next summer, will begin work next week "after his work permit formalities are completed," Villa said.
"He has also enjoyed notable success at Sevilla and at Paris St-Germain. In Seville, he won three successive Europa League titles between 2013 and 2016 before going on to lift a Ligue 1 championship in France as well as two French Cups, two French League Cups and two Trophee des Champions."
The Spanish club also reached last year's Champions League semi-finals under Emery, losing 5-2 to Liverpool on aggregate.
Emery's Villarreal appointment followed his sacking after just 18 months as Arsenal manager in November 2019, after failing to win in seven games - the Gunners' worst run at the time since February 1992.