Leeds sacked Jesse Marsch earlier this month following a poor run of form.
The Elland Road outfit have placed under-21 boss Michael Skubala in temporary charge for their last three matches but he failed to win any of them.
The Whites have not won any of their last ten Premier League games and a 1-0 defeat to Everton on Saturday left them in 19th position on the Premier League table.
Gracia's first game in charge of Leeds will be against bottom club Southampton this weekend.
Confirming Gracia's appointment, Leeds said in a statement: "Leeds United are delighted to announce the club have agreed terms with Javi Gracia to become men's first team head coach, subject to obtaining a work permit.
"The experienced 52-year-old has agreed a flexible contract at Elland Road."
''The club hope Gracia’s first game in charge of the Whites will be Saturday’s Premier League clash against Southampton at Elland Road, subject to obtaining the necessary work permissions.''
Gracia managed Watford between January 2018 and September 2019, leading the Hornets to an FA Cup final in his only full season in charge.
Spaniard counts the likes of Osasuna, Valencia, Malaga and Al Sadd among his former clubs.