What a difference a year can make.

Last autumn, motorists were just recovering from gasoline lines and odd-even-day sales restrictions, and oil refineries were running at full capacity to assure enough heating oil for the winter.

Today, the United States is awash in oil and petroleum products once again. Motorists are able to look for gasoline bargains. Heating oil and natural gas distributors each claim to offer the cheapest fuel for homes and businesses, and they are fighting it out in court.

The turnabout is due in part to improvements in energy conservation that would have seemed far-fetched to energy planners only four years ago -- and due also to a recession that has bitten deeply into industrial fuel demands.

Understandably, President Carter boasts of the improved conservation as proof of a successful energy policy. Understandably, Republican challenger Ronald Reagan says conservation is no big achievement if the economy is struggling through a recession.

The facts are that gasoline consumption so far this year is 6.8 percent less than in 1979, and shipments of imported oil to the U.S. in July dropped to a five-year low of 4.8 million barrels a day. A year ago, crude oil imports were nearly 2 million barrels a day higher.

Local heating oil stocks are 50 percent higher than a year ago, according to estimates of Leonard P. Steuart II, president of Steuart Petroleum Co., reflecting an unprecedented conservation move by heating oil customers who have added insulation to homes and businesses and are putting up with cooler indoor temperatures in winter. Last year's fuel oil consumption in the area was 15 percent less than the "normal" winter of 1976-77, Steuart says, and he expects an additional 3 percent conservation this winter.

Natural gas supplies, which had to be rationed along the East Coast during the winter of 1976-77, are now plentiful enough so that Washington Gas Light Co. and other gas distribution companies are taking on new customers. WGL recently has agreed to provide new gas service to 830 homes in 13 area subdivisions whose owners are converting from oil or electric heat. It has made similar commitments to several hundred area businesses and industries, and another 29 subdivisions are lining up for conversions in the future.

Fuel stockpiles are just as full nationally. Total petroleum stocks including crude oil and products remained close to 1.35 billion barrels at the end of August, more than 13 percent higher than a year ago.

The phased removal of federal price controls on domestically produced oil -- which has helped push fuel prices higher -- also has turned underground petroleum reserves into gold, triggering a boom in exploratory drilling. A record 60,000 wells are expected to be drilled in the United States this year, and the number of rigs in use is up 30 percent over last year.

This in turn is increasing new finds. Conoco, for example, estimates that it found as much new oil and gas last year as it produced, the first time these two numbers have been in balance in 15 years.

The results have slowed the steady decline in oil and gas production from the lower 48 states.

For the entire United States including Alaska, production of crude oil, natural gal and other hydrocarbons is nearly 3 percent higher so far this year than in the first eight months of 1979.

The current petroleum surplus have brought some badly needed relief from rising energy prices. Average gasoline prices, which soared nearly 60 percent last year following the shutdown of Iranian oil fields, have not risen appreciably since March, giving motorists a chance to look for bargains once again.

Most analysts believe, however, that the recent memory of rising fuel prices has made a permanent change in attitudes toward energy conservation among consumers and business managers. As proof, they cite the change in the lineup of 1981 model-year cars.

Compacts now account for 66 percent of new auto sales compared with 48 percent only two years ago, while full-sized cars dropped from 24 percent of the market to only 14 percent. When the last oil shock ended in 1974 and the economy began to recover, many consumers seemed to forget the gasoline lines and resumed their old attachment for large sedans, station wagons and vans. Detroit automakers are assuming that this time, the trend toward smaller cars is irreversible.

For all this improvement in the energy picture, the United States still remains dependent upon the Arab members of the Organization of Petroleum Exporting Countries for nearly 40 percent of its oil imports, and the continuing stalemate on Middle East peace negotiations has increased the threat of future supply problems.

Most of the current worldwide oil surplus is due to the willingness of Saudi Arabia to continue production at 9.5 million barrels of crude oil a day during the past year, 1 million barrels a day above their official production target.

The Saudis said last week they will maintain the 9.5 million barrel rate this year, but many experts believe the figure will drop to 8.5 million barrels daily next year, with or without stepped-up tension in the Middle East. Such a reduction should not make a significant dent in the worldwide surplus until well into 1981, assuming the trend toward energy conservation isn't reversed, analysts say. The real question is whether Arab hostility toward Israel's claim to all of Jerusalem as its capital causes deeper production cuts by Saudi Arabia and a few other Arab OPEC members in November. Saudi sources reportedly plan to wait until after the U.S. presidential election before making that decision.

Despite the comfortable current stocks, there is "little reason for oil-consuming nations to feel complacent," said Petroleum Intelligence Weekly, a trade publication specializing in international oil development.

U.S. oil stocks have been high before, such as in November 1977. But the surplus steadily disappeared in 1978 as a long coal strike created heavy demands for fuel oil, and stocks declined further during the first half of 1979 following the loss of Iranian production.

Oil companies are reacting to the current high stock-piles as they did after 1977, by cutting back on refinery operations and counting on tighter supplies to make it easier to increase the prices on gasoline and fuel oil. Most gasoline, for example, is selling below the government's official price ceiling. The difference in what gasoline marketers actually have charged and what they were permitted to charge under the price ceilings exceeds $5 billion, an indication of the oil industry's incentive to reduce the current glut.