The Ravens announced the move, but they will not hold a formal news conference until their offseason program begins in mid-March, allowing Stallworth time to first meet his new teammates and coaches before addressing the media.
Stallworth served 30 days in a Miami jail last year for striking and killing a man with his car while driving under the influence of alcohol.
"We've given a lot of thought to this, and we've done extensive research into Donte' beyond football," Ravens general manager Ozzie Newsome said in a statement released by the team. "He made a huge mistake. There's no doubt about that. He has paid a significant price for that, and, as he has said, he carries a heavy weight. As (Ravens owner) Steve (Bisciotti) said, we believe in second chances, and Donte' does deserve that.
"But we've signed him because we want to get better, and we think he has a chance to help us."
Said Stallworth: "I will never get that morning back. It weighs on me every day and will for the rest of my life. What I can do is move forward, try to be a better person, try to convince others not to do what I did and warn others about the dangers of drinking and driving. I have to show otherwise that what happened doesn't reflect who I am."
NFL Commissioner Roger Goodell reinstated Stallworth last week after suspending the receiver for the 2009 season following his plea agreement on a DUI manslaughter charge. The Browns, Stallworth's team at the time, didn't have any interest in retaining his services and released him, but he worked out for several teams after that.
Stallworth spent Tuesday with the Ravens, who have a significant need at wide receiver, and had an impressive workout. He took a physical Wednesday morning and signed with the team around 11:30 a.m. ET. The sides worked on the contract overnight, with the Ravens not wanting to let Stallworth leave town without a deal.
"He's the kind of person and player who can help us," Harbaugh said. "It's clear that he is determined to play, that he has been working hard and that he wants to have a positive impact off the field, too. We're looking forward to working with him."
The Ravens aren't done seeking help at receiver, according to sources. They are still looking to expand their offense and add more weapons for young quarterback Joe Flacco. The team could re-sign veteran Derrick Mason and also is very likely to explore options for top-tier receivers such as Denver's Brandon Marshall or Arizona's Anquan Boldin.
The Associated Press contributed to this report.