"It has been my dream to play my part in taking my hometown club to the Premier League, which would be fantastic for the football club, the city of Cardiff and Wales," the 31-year-old said on the club's website on Tuesday.
Bellamy has fallen out with Manchester City manager Roberto Mancini and was not on his 25-man squad list for the new season. The Italian said last week the much travelled forward would not play for City again and was free to seek a new club.
"I'm thrilled to be coming back home to Cardiff and am excited at the prospect of wearing the shirt and playing for the club I've supported since I was a boy," said the former Liverpool, Newcastle United and West Ham United striker, who has scored 73 Premier League goals.
Manager Dave Jones added: "Bringing Craig to Cardiff is another big step in the development of this football club."
Cardiff narrowly missed out on the English top flight last season when they lost to Blackpool 3-2 in the Championship playoff at Wembley in May.
Man City ready to get Torres at right price
Mario Balotelli joins Manchester City
West Ham tell McCarthy, lose weight or face fine
Affluent Manchester City aim to join top table
Man City express interest in Donovan