Kumble, 37, was chosen to lead for three Test matches against Pakistan starting later this month at the conclusion of the current one-day series, Indian cricket board official Mohinder Pandove said.
"Kumble has been named only for the Pakistan series," Pandove told reporters in a brief statement.
Dhoni, 26, who took over as one-day and Twenty20 captain in September, was considered the frontrunner for the Test role after senior pro Sachin Tendulkar turned down an offer from the selectors.
But the five-man selection committee, headed by former captain Dilip Vengsarkar, felt Dhoni's 20 Tests in two years left the dashing wicketkeeper-batsman too raw to assume the mantle.
Kumble, a veteran of 118 Tests, succeeds his Karnataka team mate Rahul Dravid, who unexpectedly resigned as captain after the England tour in September for unspecified reasons.
The leg-spinner is India's most successful bowler and his 566 Test wickets are bettered only by Australia's Shane Warne (708) and Sri Lankan Muttiah Muralitharan (702).
The new Test captain was announced soon after Dhoni's home team crashed to a four-wicket defeat against Pakistan in the second one-day international here, which levelled the five-match series 1-1.
Kumble has captained India in a lone one-day international against England at Chennai in 2002, which his team won by four wickets.
The popular cricketer, who retired from one-day cricket after the World Cup in March, said on Wednesday he would accept the captaincy if it was offered to him.
"I would certainly do the job if asked to," Kumble told the Cricinfo website. "I don't know what the big deal is, why so much is being made of this. I have said this before also.
"I don't know whether I'm in the race, but if it's offered it would be a great honour. I have relished it whenever I had the opportunity. But that's not something for me to decide."
Former India coach Greg Chappell and ex-captain Ravi Shastri were this week quoted as saying that Dhoni was still too inexperienced to captain in Test matches.
Tendulkar, when turning down the captaincy on Tuesday, told the Indian board president Sharad Pawar that a younger man should be appointed.
"Tendulkar was of the view that presently the Indian team was doing extremely well and the board must think of appointing a younger person as the captain looking at the future of the team," a statement from the cricket board said.
The first Test against Pakistan opens on November 22 at the Ferozeshah Kotla in New Delhi, the same venue where Kumble took all 10 wickets in an innings against the same opposition in 1999.
The second Test will be played in Kolkata from November 30-December 4, while the third will be held in Chennai from December 8-12.
India are due to tour Australia in mid-December, playing four Tests, before hosting South Africa for three more Tests in March.
The ODI squad: Mahendra Singh Dhoni (captain), Yuvraj Singh, Virender Sehwag, Sourav Ganguly, Sachin Tendulkar, Gautam Gambhir, Robin Uthappa, Rohit Sharma, Harbhajan Singh, Murali Kartik, Zaheer Khan, RP Singh, Irfan Pathan, S Sreesanth and Praveen Kumar.