Stallworth was recently released by the Cleveland Browns after being reinstated by the NFL following a one-year suspension. He was suspended for violating the league's personal-conduct policy after pleading guilty to a DUI vehicular manslaughter charge.
Stallworth served 24 days of a 30-day sentence in a Miami jail for striking and killing Miami construction worker Mario Reyes with his car while driving under the influence of alcohol.
The Ravens announced the signing Wednesday.
The deal is worth $900,000, with an additional $300,000 in incentives.
"There was a time I felt the mistake I made was the end of the world for me," Stallworth said in a statement. "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.
"I have to prove that, and, hopefully, I'm on my way to doing that. I know my apology will never be strong enough for some, but I've made changes, and I'm trying to be a positive influence. It's an honor and privilege to play in the NFL, and I'm so thankful for this opportunity."
The 29-year-old Stallworth worked out for the Ravens on Tuesday.
"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. "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] has 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. We worked him out and it's obvious he is working hard to be effective. We thought it was important to sign him now, because other teams were pursuing him and we want him in our offseason program, which starts next month."
Stallworth played just one season for the Browns after signing a seven-year, $35 million contract in 2008. That year he recorded 17 receptions for 170 yards and one touchdown in 11 games.
Stallworth has caught 296 career passes for 4,383 yards and 32 touchdowns. He has played for the Saints, Philadelphia Eagles, New England Patriots and the Browns. He had a career-high 70 catches and 945 yards in 2005.
Information from The Associated Press was used in this report.