The Angola-born winger made 25 Premier League appearances for Wolves last term, scoring once, and was a key member of the team that helped the club to promotion from the Championship in 2017-18.
Leeds boss Marcelo Bielsa will hope Costa's experience of escaping the second tier will boost his side's chances of achieving promotion at the Argentine coach's second attempt, after the Whites suffered a play-off semi-final defeat to Derby County in May.
Costa scored 10 goals in 35 Championship appearances in his first season at Molineux, following a £13.4 million (€15m) transfer from Benfica.
His opportunities in Nuno Espirito Santo's side dwindled following Wolves' return to the Premier League, with Raul Jimenez and Diogo Jota typically getting the nod ahead of Costa.
Speaking about the move, Costa told the club's official website: "It feels great to sign for Leeds United.
"I’ve spoken a lot to Barry Douglas and he told me how big the club is and how amazing the fans are, so it wasn’t a tough decision to come here and I’m very happy to be here.
"It’s good to know Barry, he can show me everything about how Leeds works and I’m really looking forward to start training with my new team-mates.
"I’ve heard a lot about the gaffer, he is a great manager and I know at the end of this year I will be a better player than I am today and I’m really looking forward to working with him.
"I can’t wait to play at Elland Road soon, it is a big stadium and I’m sure the atmosphere will be great and I am ready for the challenge.
"I’m fast and I like to dribble, I would like to show good football in this stadium which is my aim and of course to help Leeds to the Premier League.
"It’s almost the same squad as last season here, the quality is there and hopefully we can push even further and get promoted this year."
Jack Harrison has also returned to Leeds on loan from Manchester City after a successful 2018-19, and 18-year-old winger Liam McCarron has joined the club from Carlisle United.
Defender Aapo Halme, meanwhile, has left the club to join Barnsley having made five first-team appearances over the 2018-19 campaign.