New Zealander Harding, whose one and only All-Black cap came against Fiji in 2002, joined Northampton in late September 2005 and played 32 games for the club. He made try-scoring debut for the Saints against Worcester.
Prior to playing for the Saints, Harding lined out for the Highlanders and the Canterbury Crusaders in the then Super 12, as well as being involved in with NPC sides Canterbury and Otago.
Ulster Rugby Chief Executive Michael Reid said: "We are extremely lucky, at short notice, to be able to sign a player of Sam's experience, intelligence and physicality. Mark McCall has no doubt that he will prove an exciting and dynamic addition to the back row."
Paul Grayson, Harding's former coach at Northampton, spoke well of the player, insisting: "Sam Harding is a fine rugby player and he has performed well in his time at Saints, he leaves Northampton with our best wishes for his future both in the game and beyond."
Harding, 26, was born in Australia and is the great-nephew of former Wales and British Lions captain Rowe Harding, who toured South Africa with the British Isles in 1924.