He became a key part of Ole Gunnar Solskjaer's side at Molde but has now decided to continue his career with Heerenveen, despite interest from clubs in the Bundesliga.
"Magnus is a very talented midfielder who is versatile and has a good passing and kicking technique," Heerenveen's technical director Johan Hansma told the club's official website.
"He played in the Under-21 European Championships in Israel and was one of the major players in the team of young Norway team, who was eliminated.
"We followed Magnus for a while and there was also serious interest from the Bundesliga for him. Therefore, we are very proud that he chooses us."
Eikrem, who was the captain of Molde, has signed a four-year contract.