Costa was a free agent after leaving Brazilian side Atletico Mineiro in January.
The 33-year-old could make his debut for his new club against Manchester City this weekend.
Wolves hopped into the free agency pool for Costa after new signing Sasa Kalajdzic suffered a serious knee injury on his debut against Southampton last weekend while forward Raul Jimenez is also out injured.
Costa previously spent three seasons in the Premier League with Chelsea, scoring 52 goals in 89 top flight appearances.
He won two titles with the Stamford Bridge outfit before a falling out with then-Chelsea boss Antonio Conte in 2017 led to his departure to Atletico Madrid.
Costa has told Wolves' official website of the targets he is setting: “Score goals. Score goals, do the best I can, give it my all. Find my place as a person, a player and understand how I actually feel because this is a big challenge.
“It’s not an easy challenge because you’re not going to play in an easy league and you can’t play it the way you want to. This is a very demanding championship, physically demanding, and it is something to test myself with and I’m ready to give it a go.”
Wolves Chairman Jeff Shi added: "We are absolutely delighted to welcome Diego Costa to Wolves, and back to the Premier League.
"A serial winner with a wealth of experience at the highest level, Diego will bring something unique to our dressing room and on the pitch, and we look forward to his impact at Molineux and Compton this season."
Costa was born in Brazil but has represented Spain at international level, winning 24 caps for La Roja and scoring ten goals.