William Wrigley, an heir to the chewing-gum fortune, announced yesterday that he is selling his 81 percent interest in the Chicago Cubs for $20.5 million in cash to the Tribune Co., a privately owned communications conglomerate based in Chicago.

The sale of the club, which has been in the Wrigley family for three generations, was approved by the Cubs' board of directors. National League owners must also approve the sale.

The Chicago National League Ball Club Inc., a publicly held company, has more than 800 other stockholders who will be informed of the details of the sale in a proxy statement. According to a Wrigley spokesman, the preponderance of those stockholders own a sentimental single share in the company, which has not declared a dividend since 1948.

The Cubs ended in the National League East Division's cellar last year and this year have the league's worst record. The sale may be welcomed by the Cubs' long-suffering fans, many of whom have blamed the club's declining fortunes on the reluctance of the Wrigley interests to spend money on the team.

At the White House yesterday, President Reagan, who as a young man did play-by-play recreations of Cub games for a Des Moines radio station, was quoted as saying: "It's the end of an era, but hopefully the beginning of another era."

A statement released by William Wrigley's office read: "Mr. Wrigley said that for some time he had been wrestling with the estate-tax problems caused by the deaths of his parents within a short time of each other, as well as with attempting to find a solution for the longer-term financial needs of the Chicago Cubs."

The Tribune Co. will acquire most of the liabilities of the Cubs as well as their assets, which include Wrigley Field on the North Side of Chicago. The stadium, with its familiar ivy-covered outfield wall, is the only major-league stadium without lights, and the Tribune said it had not decided whether to install them.

A privately held firm that publishes the Chicago Tribune and the Daily News in New York, the Tribune Co. already has ties to the Cub organization.

Its WGN radio station has broadcast Cub games since 1924, and its WGN-TV, the country's ninth-largest station, has been covering the team since 1948.

In reporting the purchase, the Tribune quoted Stanton R. Cook, president of the company, as stating that, "The company's newspaper and broadcast subsidiaries would continue the independent coverage of the news of baseball consistent with the company's editorial tradition."

This marks the second sale of a Chicago baseball team within a year. Earlier, a group headed by Bill Veeck sold controlling interest in the Chicago White Sox to a group headed by Eddie Einhorn and Jerry Reinsdorf.

The Cub deal is another example of big companies investing in professional teams. Indeed, in pro sports only the National Football League, whose constitution bars corporate ownership, has been immune from the conglomerate sprawl.

A Wrigley spokesman said of the team's financial situation: "It has been up and down, but the Cubs haven't been profitable for a number of years."

Public filings seem to bear him out.

In 1980, the Cubs had gross revenues of $10.7 million, down about $400,000 from a year earlier, while their income column (before extraordinary items) showed a loss of $1.8 million, down from a slight profit of $74,038 in 1979.

Chicago Mayor Jane M. Byrne, in a telegram to Cook, said "Recalling the fabled days of Tinker to Evers to Chance, you have my best wishes for success. Play ball."