Godleman was a standout performer in 2015 with more than 1,000 Division Two runs, including three centuries in as many innings, in an overall disappointing season for the county, who finished second-from-bottom.
The 27-year-old will now take charge of their attempts to attain promotion after Madsen, who signed a new three-year deal earlier this month, opted to stand down having been in the role since 2012.
Last year’s vice-captain Godleman said: “It’s a huge honour to be appointed captain. It’s an exciting time to lead the club with the strides we are making both on and off the field.
“I look forward to the opportunity to lead the side as we take the club forward and push for four-day success.”
Wes Durston will continue to lead Derbyshire in the limited-overs competitions, allowing Madsen to focus solely on his batting.
Madsen, who scored more than 1,500 runs in all three formats last year, said: “It’s been a privilege and an honour to have led the club for the last four years.”
Meanwhile Graeme Welch has signed a two-year contract extension as Derbyshire’s elite performance director until the end of 2018.
His work at Derbyshire was recognised this winter when he was asked to join the England Lions coaching staff on their tour to Dubai.
Speaking about Welch, who joined Derbyshire in 2014, chairman Chris Grant said: “Graeme has played a key part in the club’s progression over the past two and a half years and his contract extension will ensure stability for everyone involved.”
Derbyshire open their championship campaign against Gloucestershire in Bristol on April 17.