In a statement posted to social media on Saturday, the batsman said his seven-year tenure had been comprised of "hard work, toil and relentless perseverance to take the team in the right direction."
"I've done the job with absolute honesty and left nothing out there," Kohli said. "Every thing has to come to a halt at some stage and for me as Test Captain of India, it's now."
The 33-year-old -- who first deputized for then-Test captain Mahendra Singh Dhoni in 2014 and later began his official tenure as Test captain in June 2015 in Bangladesh -- has led India in a total of 68 test match series, with 40 wins and 17 losses.
On Friday, the Indian cricket team suffered a 2-1 defeat against South Africa in Cape Town, with Kohli acknowledging on social media that it was "a tough one to take."
"I have always believed in giving my 120 percent in everything I do, and if I can't do that, I know it's not the right thing to do," Kohli said. "I have absolute clarity in my heart and I cannot be dishonest to my team."
Kohli, who is regarded as one of the greatest cricketers of all time, previously served as India's captain in both Twenty20 (T20) and One-Day International (ODI) matches.
In November 2021, he stepped down as T20 captain, saying he had an "immense workload" and needed to be "fully ready to lead the Indian Team in Test and ODI Cricket."
The following month, he was then removed as India's ODI captain by the team's selection committee and replaced by Rohit Sharma, who also took on India's T20 captaincy.
During his time as captain, Kohli was praised for taking paternity leave halfway through a Test series to be present for the birth of his first child with his actress wife Anushka Sharma, and for defending bowler Mohammed Shami from Islamophobic trolls.
Kohli will continue to play for India as a batsman, with a series of ODI matches against South Africa scheduled for next week.