Gates, recently acknowledged as the richest man in the world for the 13th year, will be the principal speaker at Afternoon Exercises during Harvard's 356th Commencement in June, where he will receive an honorary degree.
Paul Finnegan, president of the Harvard Alumni Association, said: "I am very pleased that the Harvard community will have the opportunity to hear from Bill Gates on 7 June.
"His contributions to the world of business and technology, and the great example he has set through his far-reaching philanthropy, will rightfully put him on centre stage in Harvard Yard."
Gates is a member of the Harvard College class of 1977, which will celebrate its 30th reunion during Commencement Week.
The future co-founder of Microsoft arrived at Harvard as a freshman in 1973 and, while at Harvard College, pursued his passion for computer programming.
He also came to know his classmate and future business partner Steve Ballmer, who lived down the hall at Currier House.
As an undergraduate, Gates teamed up with his childhood friend Paul Allen to develop a version of the Basic programming language for the first microcomputer, the MITS Altair.
He left Harvard during his junior year to devote himself to building Microsoft, the company he and Allen founded in 1975. Gates has gone on to accrue a net worth of $56bn.
Gates plans to step down from his day-to-day role at Microsoft from July next year to devote more time to the Bill and Melinda Gates Foundation, although he will remain as chairman.
With an endowment of more than $30bn, the Gates Foundation is the world's largest philanthropic foundation and currently makes grants totalling more than $1.5bn a year.
Cotton seedling freezes to death as Chang'e-4 shuts down for the Moon's 14-day lunar night
Fortnite easily out-earns PUBG, Assassin's Creed Odyssey and Red Dead Redemption 2 in 2018
Meteor showers as a service will be visible for about 100 kilometres in all directions
Saturn's rings only formed in the past 100 million years, suggests analysis of Cassini space probe data
New findings contradict conventional belief that Saturn's rings were formed along with the planet about 4.5 billion years ago