The 24-year-old Iceland international arrived at The Valley last summer on a two-year deal from Dutch side AZ Alkmaar and impressed with 11 goals in 44 appearances last season.
“It feels really good,” Gudmundsson told the club’s official website.
“We’ve been talking about it for a few months. Now it’s done I can concentrate on my football and help the team to a good start in the Championship.
“We want to build a squad for the future and I’m a part of that. Now we know that the football club is serious about what we want to do.”