The Gulf Oil Corp. will pay the U.S. government $42.2 million as a settlement of claims that it overcharged customers $79.9 million for crude oil after the Arab oil embargo.

The White House announced the settlement yesterday in unusual detail, apparently as part of its increasing effort to win approval from a public it believes has been ill-informed on Carter administration achievements.

The Gulf compromise was the largest settlement so far in the Energy Department's massive investigation into oil company pricing practices after the 1973 embargo.

Thirty-three enforcement proceedings have been brought against oil companies. More than $1 billion in claims have been filed, with the vast bulk under challenge by the firms, the Energy Department said yesterday at a press conference after the White House announcement.

The announcement came at a useful time for the administration. Critics of the natural gas deregulation compromise now before Congress have charged the administration and others with caving in to big energy interests by going along with it.

The government accused Gulf in April 1977 of overstating the price its foreign affiliates paid for crude oil from six countries from October 1973 to May 1975.

That, in turn, allegedly allowed the company to charge prices beyond the level permitted by federal regulations to perhaps a million customers, Energy Department officials said.

The settlement between the government and Gulf, which made no admission of wrongdoing, was for slightly more than half the original claim. "It is a compromise," said Deputy Energy Secretary John F. O'Leary, "and a compromise is always open to question. Did you get as much as you could?"

There is no immediate prospect for compensation to consumers who bought Gulf at the pump. O'Leary said his agency would attempt to work out a system for individual claims, though some of the amounts might be impossible to determine and miniscule.

Most of the money is expected to wind up in the U.S. Treasury.

The Energy Department, formerly the Federal Enegy Administration, was criticized by a special task force a year ago for failing to vigorously pursue compliance by oil companies.

Following that study, the department created an Office of Special Counsel under Paul Bloom to step up enforcement. This year and next, that office expects to spend about $40 million to finance the work of more than a thousand lawyers, auditors and computer experts assigned to the project.

In a prepared statement yesterday, Gulf Oil said that "a substantial part of the transactions in question took place during the Arab oil embargo, when prices and market conditions fluctuated rapidly and oil-producing countries dramatically raised prices."

The government promulgated its regulations afterwards, Gulf said. The company "actually charged prices for some crudes at levels less than those determined by regulations."

The government's enforcement actions have been harshly criticized by some of the companies who contend that the regulations were confusing to the point of being unintelligible.

Bloom has said previously that some oil companies violated the law because they knew they could make money doing it and because they felt that if they were ever punished, the reprimand would come in the form of noncriminal penalties that would cost less than obeying the statue.