The 26-year-old, who will formally become Lee Clark's first signing ahead of the 2014/15 campaign on July 1, operates predominantly as a left-back but can also stand-in at centre-back if required.
Grounds, who was born in North Yorkshire, began his career at Middlesbrough, where he came through their academy system.
During his five-year professional spell at Boro he spent several periods out on loan at Norwich City, Hibernian, Chesterfield and Yeovil Town.
In 2012 he joined Oldham Athletic and during his two-year stint at the Latics made 106 appearances and scored three goals.
Blues boss Clark, who worked with Grounds during his time as assistant manager at Norwich, told bcfc.com: "I am delighted to welcome Jonathan to the club and he is somebody who both myself and (chief scout) Malcolm Crosby know a lot about from his time at Middlesbrough.
"Jonathan's versatility will be important for us as he can play as a left-back or left-sided centre half. We conceded far too many goals last season so it was key that we strengthened our defence and Jonathan will help us to do that.
"He has a lot of experience and I can see in his eyes that he has that hunger as he was always determined to get back playing in the Championship."
Head over to our official YouTube
channel for an exclusive interview with the new recruit.