The announcement comes ahead of the World Cup hosted by Australia and New Zealand from February to March, with the Afghanistan Cricket Board (ACB) looking to the Englishman's international experience to help the fast-rising team.
Moles, 53, said he looked forward to the challenge.
"I am very excited as I take on the role of national coach for Afghanistan," he said.
"The ACB has a very talented bunch of players and I am looking forward to the challenges of working with them to help them reach the pinnacle of their performance as individuals and as a team."
More From This Section
War-ravaged Afghanistan has risen quickly through cricket's ranks since reforming their team in 2004.
They rose from division five to division one over the course of 2008, and gained one-day status in 2009.
Afghanistan have also featured in three World Twenty20 tournaments -- 2010, 2012 and 2014 -- and last year qualified for their maiden 50-over World Cup.
ACB chief executive Noor Mohammad Murad said former Pakistan paceman Khan's resignation would not affect Afghanistan's preparations for cricket's premier competition.
"Some media outlets have described Kabir Khan's resignation as a setback and a major blow for Afghanistan cricket," he said in a statement.
"Whilst Khan shared his particular skills with our players over a long period, Moles brings different and needed skills and approaches to the position.
"He comes to us at this important time with a wealth of experience in international cricket...This will enrich and broaden the development of our national team."
Murad accepted the change was not ideally timed as Afghanistan tours Australia and New Zealand next month in preparation for the World Cup.