His resignation will take effect from 1 February.
Mr Kim, 59, was not due to leave until 2022 after he was re-elected for a second five-year term in 2017.
He will "join a firm and focus on increasing infrastructure investments in developing countries", the World Bank said.
"It has been a great honour to serve as President of this remarkable institution, full of passionate individuals dedicated to the mission of ending extreme poverty in our lifetime," Mr Kim said in a statement.
No reason was given for his unexpected resignation.
World Bank chief executive officer Kristalina Georgieva will assume the role of interim president.
The World Bank has a remit to support international development projects. Formed in 1947 to help rebuild European countries devastated by World War II, it supports infrastructure projects with traditional loans, interest-free credits, and grants.
Mr Kim - who was born in Seoul, South Korea - trained as medical doctor before rising through the ranks at the Bank.
Positioned at 41 in Forbes' Power People 2018 list, he has presided over the dispersal of billions of dollars of World Bank funding. In 2018, the institution made financial commitments worth $67 billion.