The former Leicester City midfielder joins Birmingham for an undisclosed fee and has signed a three-year contract.
Gray came through the system at Birmingham, making his debut as a 17 year-old in 2013.
"To be back here now means a lot and having tasted success a bit throughout my career, I'm hungry and I really want to do it here with Birmingham and try and help the team get back to where we belong," Gray told the Blues website.
"It's something I've wanted for a long time. Seeing some old faces is always nice, to be back around the stadium brought back a lot of feelings and I can't wait to get going now, get back in front of the fans and see where this season can take us.
"It's different to just signing for another club. For me to have the opportunity to come back home, be around my family, watch my son grow up, him being able to watch me play games, at the club I started at, makes sense.
"Especially at the point of my career now, it's perfect. I'm happy, I'm excited, and I want to win things and be successful here in front of my family."