Exxon Corp. and Standard Oil of California, the world's largest and fourth-largest oil companies, yesterday reported substantial declines in profits and sales in 1982, the second year of a steep tailspin for the entire industry caused by the continuing oil glut.

Exxon said its 1982 earnings were down 13.3 percent while sales were down nearly 10 percent from the year before, although the fourth quarter showed some improvement. Exxon's results were generally better than industry analysts had anticipated in a year of fierce oil price competition.

Standard Oil of California reported a 42 percent decline in profits for the year and a 25 percent drop in earnings for the last quarter.

Both companies were hurt by the same factors that have plagued the oil industry this year--reduced demand, price cutting and the recession's impact on oil-related industries.

"The year just concluded must be judged as a difficult one for the petroleum industry," said Exxon Chairman Clifford C. Garvin Jr.

In addition, both Exxon and Socal are members of Aramco, the Arabian-American Oil Co. partnership that exports Saudi Arabian oil to world markets. The relatively higher prices of Saudi crude raised the costs of the Aramco partners.

"When you pay $2 a barrel more than anyone else, it makes a bad problem a bit worse," noted Paine Webber Mitchell Hutchins Inc. analyst Bruce E. Lazier. Aramco partners, which also include Mobil and Texaco, have continued to buy the higher priced Saudi Arabian oil to maintain their access to the huge reserves there.

Although Aramco partners as a group are expected to report generally poorer results than the rest of the industry, the industry in general is expected to do badly for the second year in a row. Industry economists and analysts expect the slump to come to a halt in 1983, particularly if the disarray in the Organization of Petroleum Exporting Countries is resolved, as some expect.

At least in the short run, though, prices may continue to decline. Gasoline marketing analyst Daniel Lundberg said yesterday that he expects gasoline prices to drop by a total of 10 cents a gallon in the first three months of 1983. Prices already have declined 4 cents a gallon this year, he said.

Exxon's fourth-quarter profits rose 6.9 percent to $1.48 billion ($1.71 a share) from $1.38 billion ($1.60) a year ago. However, last year's fourth-quarter profits were 20 1/2 percent lower than those in 1980. Sales in the latest quarter were $26.24 million, down 11.9 percent from $29.8 million a year earlier.

For the full year, earnings are estimated at $4.185 billion ($4.82) on sales of $103.6 billion compared to $4.826 billion ($5.58) in 1981, when sales totaled $115 billion.

Exxon's results were reported on the basis of a new foreign currency standard issued by the Financial Accounting Standards Board. The company said that its latest results would have been higher without the change.

Socal's annual earnings were $1.38 billion ($4.03) compared with $2.38 billion ($6.96) in 1981. Sales for the year were $35.22 billion compared with $45.22 billion the year before. Earnings for the quarter were $425 million, down from $571 million.

The company blamed the declines on reduced demand worldwide and the relatively higher prices it paid for Aramco oil. Socal's results were improved somewhat by a $400 million inventory draw-down benefit and a $39 million foreign exchange gain. Those gains were offset, however, by some $150 million in write-offs, including the shut-down of European refineries, the cost of pulling out of a tar sands project in Canada and the company's withdrawal from the synthetic fiber business.

Union Oil Co. of California yesterday reported a 1.6 percent increase in net earnings from $791.4 million in 1981 to $804 million in 1982. For the fourth quarter, however, net income was $225.1 million, down 4.6 percent from $236 million in the fourth quarter of 1981.

On Monday, four major oil companies reported weakened earnings for 1982. Atlantic Richfield Co., which suffered from losses in its mineral, chemical and metal-fabricating businesses, reported that revenues in 1982 were $26.999 billion compared with $28.208 billion the year before. Earnings were up slightly, from $1.671 billion in 1981 to $1.676 billion in 1982. Fourth-quarter earnings were down 7.6 percent, however.

Ashland Petroleum Co. said its earnings for the most recent quarter were down by 39 percent. Getty Oil Co. reported a 20.2 percent decline in earnings for the last quarter, and Standard Oil Co. (Indiana) reported an 8 percent increase for the same period. That increase reflected, in part, how bad the company's previous fourth quarter had been.

Market analysts said they expect oil company earnings to pull out of their slump this year. Most of the recovery is expected to occur in the second half of the year. That assumption rests on the expectation that the economy will recover somewhat, demand will increase, and oil price reductions will not be steep.

Even so, the industry must adjust to a new environment in which demand probably has been permanently altered. Demand has fallen by about 13 percent since 1979. Exxon's Garvin has estimated that two-thirds of the reduction in oil consumption in the past two years reflects conservation measures that are not reversible.