The 23-year-old is a full Republic of Ireland international, making one appearance and the central midfielder comes to the club as a replacement Richard Kell, who joined Barnsley on Thursday.
He has made 118 appearances for the Hatters since joining them in 2002, scoring nine goals.
He was highly regarded by Stockport fans who saw the player as an inspirational figure at the club, captaining the side, and also captaining the Eire Under-21's in the past.
He is described as a tough-tackling midfielder, and was released by relegated Stockport as they couldn't afford his wages. He can also operate in defence.
The 5' 9'' player started his career at Scottish giants Celtic, making one appearance for the Bhoys, against Dundee United
"Jim has been superb, a good captain, and trainer," Stockport boss Chris Turner said.
"But I couldn't offer him a contract which matched those offered by other clubs."
Iron manager Brian Laws will be hoping to get the best out of his new midfield dynamo.
He is the club's third summer signing following Richard Hinds and fellow Irish midfielder Richie Ryan into the club.
A striker is expected to be the next new arrival at Glanford Park.