The U. S. Department of Energy yesterday granted an immediate 12 percent increase in gasoline prices by telling service stations operators they can charge 15.4 cents a gallon over the wholesale price they pay.

A spot check of dealers here indicated that most of the 1,500 service stations will raise their prices 3 to 5 cents a gallon, pushing the average price of premium grades of gasoline over the $1 mark.

The rule change marked another paradox of Carter administration policy during the gasoline shortage: the main object of the new rule, officials said, was to "provide new protection for consumers" and to simplify complex pricing rules for dealers.

The gross profit ceiling granted under the rule is more than double average dealer profits during the first quarter of this year.

"I've been waiting for this for a long time," said Art Askins, owner of the Phillips 66 station at 5930 Greenbelt Rd. in Maryland. Askins said the new ceiling will allow him to raise his prices 5.4 cents a gallon.

"It's clear that the price will go up because of it [the rule change]," said Gus Smith, manager of the Wildwood Manor Exxon station in Bethesda.

The rule change also will geve the stations owners twice-yearly profit increases as an adjustment for inflation.

The new ceiling was designed to eliminate in the future what has clearly been the most embarrassing element in the federal energy department's management of the current shortage: Gasoline prices at the pump have been going up much faster than actual increases in the cost of crude oil from oil-producing nations.

Beyond the inconvenience and waste of sitting in gasoline lines, millions of Americans have learned that the price-control system set up by the government has acted precisely as if there were no price-control system.

Early on, federal energy officials said increased profit taking was occurring at all levels of the oil industry, but mostly at the retail station level.

This was possible because of a loop-hole in the price controls established during the 1973-74 Arab oil embargo. At the time, profit ceilings were based on what dealers were charging on May 15, 1973. However, the regulations acknowledged that in times of stiff competition and plentiful gasoline supplies, dealers might not be able to collect the maximum allowable profit margins.

Thus the rules allowed dealers to "bank" profits during lean years, save them up on paper and collect them from customers during times of shortage and high demand.

Federal energy officials and industry analysts have acknowledged that under this system, the American public is paying back all the money saved during preceding competitive years.

As a result, gross profits on a gallon of gasoline rose from 6.6 cents in January to 13.7 cents in mid-July, according to a survey of 17,000 stations by the authoritative oil industry newsletter, The Lundberg Letter.

The new ceiling of 15.4 cents thus marks a 12 percent price increase nationwide.

Gasoline dealers have contended that the national shortage has hurt all but the high volume stations whose cut-rate prices allowed them to accumulate the greatest amount of "banked" profits. Inflation, rent and labor increases all have added to costs while profit margins have been frozen, the dealers say.

Full service stations particularly, the dealers argue, have not fared well becase they have operated with smaller volumes and higher profits in recent years.

In the few months, discontent among dealers has grown so high that some have raised the possibility of a nationwide strike. Last weekend, many dealers in Pennsylvania and Delaware shut down for the weekend in protest.

During a press conference, David J. Bardin, the energy department's cheif regulatory official, said the rule change applies to about three-quarters of the nation's gasoline dealers.

Bardin discounted the impact of the rule on prices, saying the expected it to hae "very little" effect since his own estimates showed that gasoline dealer margins currently are between 14 and 16 cents a gallon.

Nevertheless, Bardin said, " . . . gasoline prices are going to continue to go up" because most of the impact from the latest round of OPEC (Organization of Petroleum Exporting Countries) price increases have yet to be felt. The OPEC increase - effective July 1 on the oil tankers leaving the Middle East for the 45-day trip to the U.S. - is expected to add an additional 5 to 6 cents to prices at the pump.

The new ceiling on profits will not apply to increased crude costs passed from the refiners to the stations on a dollar-for-dollar basis.

The rule changes also do not eliminate the practice of passing on banked profits by the oil companies and their middlemen.

under the new rules, dealers will be required to post "in a prominent place" both his maximum allowable selling price for each grade of gasoline and his maximum gross profit margin.

However, consumers will not be able to determine, at a glance, whether a station is complying with the new rules unless the consumer knows the wholesale price paid by the dealer.

Three other rule changes were announced by Bardin during yesterday's press conference.

New gasoline stations were limited to supplies of 50,000 gallons a month, a relatively low figure intended to discourage a proliferation of new stations during a time of tight supply. This rule will be rescinded Oct. 31 unless extended.

Priority consumers - beginning Aug. 1 - will no longer be allowed to demand unlimited new supplies of gasoline, but will be restricted to the same amount they received last year.

Effective Sept. 1, wholesale distributors of gasoline, called "jobbers," no longer will be allowed to keep control of gasoline intended for customers who have gone out of business. Bardin said this rule change should cut down on gasoline diverted to the so-called "spot market," outside the normal government-controlled supply chain.

One controversial rule that the energy department left in place is the one that gives more gasoline to stations in high growth areas of the South and Southwest, as well as suburban and rural resort areas.

The effect of this rule was spotlighted during a much-publicized conversation overheard between President Carter and Energy Secretary James R. Schlesinger in which the president asked if the government allocation system was putting gasoline supplies where the cars and Schlesinger replied that the system was putting the gasoline where the cars are not.

Said Bardin of the much-maligned rule: "The data does not substantiate the fear of bias in favor of one section of the country over another."

Bardin also said that once gasoline supplies again are balanced with demand, he expects competition between stations to result in dealers not taking the maximum allowable margin. He declied to predict whether that would occur this year. CAPTION: Graph 1, Local tax is 10 cents a gallon in D.C., 9 cents in Virginia and Maryland. By Alice Kresse - The Washington Post; Graph 2, Per Gallon Gross Profit for Gasoline Stations; Picture, David Bardin lists regulations aimed at relief in pricing, allocation of gasoline. AP