The investor's decision comes weeks after Gates' appearance before US Congress over his links to Jeffrey Epstein.
"Of course, mortality is unpredictable," said Buffett. "But my remaining shares will be donated to the four foundations one way or the other by 31 December, 2034."