The 21-year-old, who spent periods on loan at Southend United and Accrington Stanley last season, departed Bolton on a free transfer last month.
Morecambe boss Jim Bentley told the club's official website: "Jack has a good pedigree and has loads of potential. He's been at Wigan and Bolton and played in the league on loan at Southend and Accrington and I think he will have a lot to offer.
"He is still only young and we won't put too much pressure on him but I am really pleased that he has joined us. He has played for England (at Under-19 level) and comes highly recommended and I am sure he will make progress with us over the next two years."
Sampson began his career at Wigan Athletic.