Hanley initially joined on a four-year deal from Newcastle in 2017 and has since gone on to make 40 appearances for the Canaries.
The 26-year-old centre-back is now looking forward to a long future at Carrow Road after being named club captain at the start of the season.
"I'm over the moon. When I first heard it might happen I was buzzing and I just wanted to get it done as soon as I could," Hanley told Norwich's website.
"From the moment I walked in the door I felt so welcome, everyone around the place from the staff, the fans and the players have been absolutely brilliant, and not just to me but with my girlfriend as well.
"She has really settled in and is enjoying living in Norwich which is a big thing for us, so we are over the moon that we can get that bit of security and be here for even longer."
Hanley has been out of action since suffering a quadricep injury against rivals Ipswich on September 2.
The Scotland international is keen to return to first-team action as quickly as possible with Norwich pushing for promotion to the Premier League.