Warren Buffett, Jeffrey Bezos, Mark Zuckerberg and a handful of other top executives notched multibillion-dollar paper gains from their companies' shares in 2013, highlighting the outsize winnings some corporate insiders made during last year's rally.

Mr. Buffett's holdings of Berkshire Hathaway Inc. appreciated by $12.7 billion last year. Amazon.com Inc. shares held by Mr. Bezos jumped by $12 billion in 2013, while the value of Mr. Zuckerberg's stake in Facebook Inc. surged by $12 billion.

All told, the 20 executives with the largest ownership stakes in companies that are part of the S&P 500 reaped paper gains of $80.9 billion last year, according to a study conducted by The Wall Street Journal and FactSet. These executives pocketed an additional $7.3 billion selling shares during the year. The figures don't include the value of options held by executives. The S&P 500 climbed 30% in 2013.

The nature of paper stock gains is that they can be reversed if executives don't sell or if stocks fall, of course. The value of Bill Gates's Microsoft Corp. stake tumbled by $28 billion from September 1999, when the shares neared an all-time high during the tech boom, to September 2000, when the sector was under heavy selling pressure, according to the company's filings.

Indeed, with stocks starting 2014 on the wrong foot, Mr. Buffett has seen his stockholdings drop more than $2.8 billion this year. But Mr. Zuckerberg's stake has increased $3.4 billion, thanks to the 13% rise in Facebook's shares in 2014. The S&P 500 is down 5.8% this year.

One clear lesson from last year's stock gains: In a bull market, the spoils go to those who manage to hold on to their shares, resisting the temptation to sell. The 2013 gains also show how passive investors, such as executives with large stakes and individuals buying index funds, outperformed many hedge funds and other managers who actively managed portfolios during the market's largest rally in more than a dozen years, underscoring a shift in power from Wall Street pros to executives of hot companies.

"There's been a major shift of power and sentiment" from Wall Street to corporate America, said Michael Holland, chairman of Holland & Co., a New York investment company. "No one knows how long it will last, but these things tend to stay in motion for a while."

Last year, Facebook rose 105%; Amazon, 59%; and Berkshire Hathaway, 32%.

Some insiders sold part of their stakes. Mr. Zuckerberg, founder, chief executive and chairman of Facebook, sold almost $2.3 billion of shares during the course of the year. He said in a filing in December that the majority of the net proceeds would be "used to satisfy taxes that he will incur." He still held $23.3 billion of the Menlo Park, Calif., company's shares at year-end. A Facebook spokesman declined to comment.

Mr. Bezos, founder, chief executive and chairman of Amazon.com, sold $711 million of stock, leaving him with a stake valued at $33.9 billion at the end of 2013. Amazon declined to comment.

Those selling typically disposed of just a small percentage of shares. Many, including Mr. Buffett, have pledged to make big charitable contributions, often funded by their stock. Mr. Buffett owned $60 billion of Berkshire Hathaway shares at year-end.

"Mr. Buffett has never sold any shares at any time, including during the past year. All of his shares will go to philanthropic organizations," a Berkshire spokeswoman said.

Large executive shareholdings are often applauded by corporate-governance specialists, who said a substantial stake in a company helps ensure management makes decisions that will benefit shareholders.

Many of the stock gains were reaped by executives at top companies in the technology sector, which has been favored by many investors in recent years for its putative growth prospects.

Google Inc. co-founders Larry Page and Sergey Brin saw the value of their shares rise by almost $9 billion each. Messrs. Page and Brin sold shares valued at $879 million and $966 million, respectively, during the year, leaving each with stakes valued north of $26 billion. Google's shares rose 58% in 2013. A Google spokesman declined to comment.

The value of the Microsoft shares held by co-founder Mr. Gates rose by $1.6 billion, and Mr. Gates sold $2.5 billion of shares. He holds $13.4 billion of stock. The stake of Steve Ballmer, the company's outgoing chief executive, rose by $3.5 billion, to $12.5 billion. Microsoft's shares advanced 40% last year. A Microsoft spokesman said Mr. Gates is on a "structured divestment plan" covering 20 million shares each quarter.

The Oracle Corp. stake held by the Redwood City, Calif., company's chief executive, Larry Ellison, rose by $5.5 billion last year, to $42.6 billion. An Oracle spokeswoman declined to comment.

The increases in top executives' stakes echo heady returns achieved in some past bull markets, such as the tech boom that ended in 2000 and the 2009 rebound from the financial crisis. Mr. Bezos's Amazon shares gained more than $7.7 billion in 2009, according to FactSet.

While many executives did well last year, most hedge funds, which often place bearish bets to protect against downside risk or try to actively time the market, failed to keep up with the rally. This underperformance has raised questions among some investors about the value the funds create in return for often-high fees.

Stock-focused hedge funds overall failed to capture even half of the U.S. stock market's gains last year. The average such fund rose 14.4%, according to HFR Inc., while funds across all strategies returned 9.3% for the year, according to the hedge-fund tracker.

"It was a tough year for hedge funds investing in stocks," said Ken Heinz, president of HFR. "Bets against many stocks lost money, while many were too cautious on the market."