After a weekend of negotiating, the board of directors of Twentieth Century-Fox Film Corp. agreed yesterday to merge the diversified entertainment company into a firm owned by Marvin Davis, a press-shy Denver oil wildcatter, and his family.

The merger, with a reported value of $800 million, came only days after negotiations had broken down and the deal apparently had been called off.

The merger was announced by Dennis C. Stanfill, chairman of Fox, whose films include "Star Wars" and more recently "Alien." He said the merger will be presented to interested regulatory agencies and to shareholders at a meeting in early June.

Under terms announced yesterday, Fox shareholders would get prior to the merger one share of United Television Inc., the spin-off company that owns Fox's three television stations, for each share of common and 1 1/3 shares of UTV for each share of preferred. After the merger, Fox stockholders would get $60 for each common share and $80 for each preferred.

The UTV option reportedly was arranged to satisfy Herbert J. Siegel, chairman of Chris-Craft Inc., which is the biggest holder of Fox's outstanding shares, with 22 percent. Chris-Craft now stands to become a controlling stockholder in the television company.

The uncertainty over the merger had left Fox vulnerable to takeover by others as Wall Street arbitrageurs quietly acquired Fox stock in anticipation of a deal with Davis. If it had not gone through, these speculators might have sold their stock to someone else, perhaps less pleasing to Fox management than Davis.

Davis, who ranks second to Amoco Production Co. as the biggest driller of wildcat exploratory leases, has been flush with cash since January when he got $600 million for some of his holdings from Hiram Walker-Consumers Home Ltd. of Toronto.

Davis, 55, who has a reputation as a hard-nosed speculator, is an imposing figure. He is 6-feet, 4-inches tall and weighs 300 pounds.

He owns one of Denver's biggest banks, and a large chunk of its downtown real estate. A sports enthusiast, he tried unsuccessfully to acquire to Oakland A's professional baseball team and move them to Denver.

Fox has diversified in recent years. Besides its film operations, it owns Coca-Cola Bottling Midwest in St. Paul, television broadcasting and resort and recreation operations.

Its Aspen (Colo.) Skiing Corp. controls all the physical assets on the mountains plus the lodge below. Fox also owns the Pebble Beach Corp. south of San Francisco, which includes three golf courses and a shopping center.

While its resort group contributed only about $13.9 million to Fox's net income of $97.9 million in 1980, these holdings include some "undeveloped and potentially valuable real estate," according to Anthony Hoffman, an entertainment-industry analyst with A. G. Becker Inc. in New York.

For example, says Hoffman, the resort group has 2,500 to 3,000 acres of the Del Monte Forest at Monterey, Calif., whose development has been delayed by environmental and regulatory problems. "Clearly, Davis has to be looking at the potential value of that property in making this deal," says Hoffman. "The ego trip of getting into the film business wasn't his only reason."