Kohli led India in all three formats until the Twenty20 World Cup last month, after which he relinquished 20-overs captaincy which went to Rohit.
Many expected Kohli, who remains the Test captain, to lead India in the 50-overs World Cup on home soil in 2023 but the board opted for a single white-ball skipper.
"The All-India Senior Selection Committee ... decided to name Mr Rohit Sharma as the captain of the ODI & T20I teams going forward," board secretary Jay Shah said in a statement.
Under Kohli, India reached the semi-finals of the 50-overs World Cup in 2019 but could not advance beyond the group stage at this year's T20 World Cup in the United Arab Emirates.
In further indication of Rohit's growing stature within the team, the 34-year-old also replaced fellow Mumbai player Ajinkya Rahane as vice-captain of the Test side.
Rahane is part of the 18-member squad that will travel to South Africa but must snap his woeful run of form to maintain his place in the side.
Beginning on Dec 26, India are scheduled to play three Tests in South Africa, followed by three one-day internationals.
Rohit, who was rested for the home series against New Zealand, returns to the Test side, along with fellow opener KL Rahul, first-choice wicketkeeper Rishabh Pant and fast bowlers Mohammed Shami and Jasprit Bumrah.
Opener Shubman Gill and spin-bowling all-rounders Ravindra Jadeja and Axar Patel missed out with injuries.
India Test squad: Virat Kohli (captain), Rohit Sharma (vice captain), KL Rahul, Mayank Agarwal, Cheteshwar Pujara, Ajinkya Rahane, Shreyas Iyer, Hanuma Vihari, Rishabh Pant, Wriddhiman Saha, Ravichandran Ashwin, Jayant Yadav, Ishant Sharma, Mohammed Shami, Umesh Yadav, Jasprit Bumrah, Shardul Thakur, Mohammed Siraj.