The Iceland international joined the Terriers on a free transfer in June 2010, making 56 appearances and scoring two goals.
Gudjonsson, who has also played for Premier League sides Aston Villa and Wolves and Championship clubs Leicester and Burnley, will return to his native country, with the Terriers guaranteed a League One play-off spot.
Gudjonsson told the club's official website: "I would have liked to have played more during my two seasons, but that is football and you have to respect those decisions and the people who make them. I've certainly enjoyed my time here though.
"I would also like to wish the fans all the best. I've always enjoyed playing in front of them as they've offered me great support and I hope they know that I've always given everything when I've been on the pitch. They deserve success at their club. I have some fond memories especially the free-kick that sealed a 1-0 win at Charlton last year as well as pushing for promotion.
"We have a great squad here and everyone, including the off-the-field staff, is pushing in the same direction. I believe this club deserves to be in the Championship and it would be a brilliant achievement to get there through the play-offs this season - and I believe that with the quality that we have, we will."