"I'm exceptionally pleased to have signed Jim," said Gloucester's Head Coach Bryan Redpath. "He's a huge physical presence who will add world-class quality to our pack.
"Any player of Jim's calibre is going to attract a number of offers, but the fact that he's chosen to move to Kingsholm after coming down to look around and meet us is a great endorsement of the direction that Gloucester are heading in.
"It was important that we take our time and get our final piece of recruitment for next season right, and in Jim we've got somebody who will contribute to our environment in a significant way both on and off the field."
Born in Swindon, 'Big Jim' progressed through the Leicester Academy before making his debut for the Tigers' Premiership team in September 2003, also scoring a try in the 2006 Guinness Premiership Final at Twickenham against Sale Sharks.
Hamilton played for England at U21 level but decided to opt for senior honours with Scotland, qualifying courtesy of his Glasgow-born father, who served for 24 years in the Queen's Own Highlanders.
He was the 1000th man to be capped by Scotland when he made an appearance off the bench against Romania in 11 November 2006, and made his first start against England at Twickenham on the opening day of the 2007 RBS Six Nations Championship.
The 6ft 8in powerhouse, who weighs in at 19st 8lb, has been capped 28 times and is due to start for Scotland on Saturday as they aim to complete a series win in Argentina.
"It feels good to get this sorted and I'm delighted to be joining Gloucester," Hamilton said today.
"As a club Gloucester ticks all the right boxes for a player - a proud history, a passionate set of supporters and a ground like Kingsholm, which is a really special place to play rugby. I met up with Bryan [Redpath] and Carl [Hogg] and what they said about how they want to play the game and the values they want to see in their team really struck a chord.
"I know Brett Deacon well from my time at Leicester and he was equally positive about the set-up. It will be great to join up with Brett again and meet up with my new team-mates in a few weeks."
Hamilton will become the fifth current Scottish international in Gloucester's squad for next season, joining Alasdair Dickinson, Alasdair Strokosch, Scott Lawson and Rory Lawson, all of whom are currently on tour with the national side in Argentina.