The world's biggest software company has not named a successor to Mr Ballmer, who took over from founder Bill Gates in 2000.
Mr Gates is on a special committee that has been formed to help find Mr Ballmer's replacement.
Microsoft shares leapt ahead soon after trading opened on Wall Street.
Mr Ballmer, who is leading an overhaul of the group into a devices and services company, said: “There is never a perfect time for this type of transition, but now is the right time.
“We need a chief executive who will be here longer-term for this new direction.”
Mr Ballmer, 57, met Mr Gates at Harvard University in 1973 and joined the group in 1980, five years after it was founded.
Mr Ballmer will remain with the group until a successor has been hired.
US headhunter Heidrick & Struggles International has also been brought on board to help the special committee with the search.
Mr Gates said: “As a member of the succession planning committee, I'll work closely with the other members of the board to identify a great new chief executive.
“We’re fortunate to have Steve in his role until the new chief executive assumes these duties."
Microsoft unveiled transformation plans last month to address concerns that it has not moved fast enough into mobile devices - an area dominated by the likes of Apple and Google.