Baltimore announced the move but did not release financial terms of the deal.
Painter, 6-foot-3 and 222 pounds, played in Indianapolis for Ravens quarterbacks coach Jim Caldwell, who was hired by Baltimore this offseason.
Painter, a former backup for Peyton Manning, started eight games for the Colts.
He was winless as a starter, passing for 1,541 yards, six touchdowns and nine interceptions.
The former sixth-round draft pick from Purdue was benched late in the season and replaced by Dan Orlovsky.