The 27-year-old's contract, that would have run out in the summer, will now run until 2016.
Chief executive Chris Turner told the club's official website: "It's great news for the club and I'm sure the fans will be delighted because Tommy is the best goalkeeper outside the Championship, in my opinion.
"He is a key part of Paul Cook's plans and we feel the loyalty he has shown to the club is fantastic."
The former Manchester United keeper added: "It's something that we've been talking about for a couple of weeks and I am pleased to sign."
Lee joined the Spireites in 2008 after a spell at Macclesfield following his release from Old Trafford in 2006.
- Sports & Recreation