Motorists formed record or near record gasoline lines yesterday -- 465 cars at one station -- to fuel their cars at the few area service stations that were opened for business on the Fourth of July.

It took some as much as three hours to get gasoline at the 10 D.C. stations listed as having gasoline to pump from 8 a.m. to noon yesterday.

At some stations not included on that widely-publicized list, it was possible to by gasoline in less than 20 minutes.

Today stations return to their regular weekday schedules under the odd-even rules in effect in the District, Maryland and Virginia. Gas should be available, particularly in the morning for motorist with odd-numbered license plates.

An official of the area gasoline dealers association had estimated that at least 70 percent of the 1,500 area stations would shut down yesterday. That many or more did exactly that, according to spot checks in the area.

But an even larger percentage of stations that were open there. All three had closed by mid-afternoon.

In Alexandria, one station was open. It had a line of about 15 cars, police said. "Maybe nobody was crazy enough to go out looking for gas," an official there said.

A line of about 100 cars formed at a Crown service station in Fairfax County. But that line shortened after the station opened, police officials said.

Prince George's County had more stations open and longer lines than Virgina. Local police estimated that about 40 stations were selling gasoline during the morning. By noon however, less than 15 were still open.

Lines of motorists in Prince George's waited up to about 90 minutes at some stations, police said.

Neither Maryland nor Virgina could match the number of cars waiting for gasoline in the District.

At Ward's Amoco, 400 Rhode Island Ave., NE. for example, the line was 10 blocks long when the manager opened at 8 a.m.

"The longest we ever had before was three or four blocks," said Nural E. Ward, the manager.

Pennsylvania, Avenue Amoco, 2500 Pennsylvania Ave. SE, had 465 cars strung out wainting in the morning. By mid-afternoon, the line had dwindled, however, "It's down to only 250 cars now," said Melvin Charles, an attendant at the station.

Those waiting for fuel didn't seen to object that much to spending their Fourth of July sitting in gasoline lines.

"I'm just grateful to get gasoline," explained Betty Herget, a Maryland resident who drove into D.C. to fuel her car at the Pennsylvania Avenue Amoco station. She waited nearly three hours before her turn at the self-service pumps came.

Other motorist got gasoline -- but not as much as they wanted.

At Davis Exxon, 4501 14th St. Nw,1 Matilda Watson edged her faded green van to the pump after a wait of about 2 1/2 hours.

She wanted a fill-up but the limit was $7. "I do housekeeping," she said. "I could have made $30 working today. But I missed work to buy gasoline. And now all I get is $7." She pleaded for more gasoline but didn't get any.

The mood was more festive at John Conner's Connecticut Avenue Amoco where motorists were allowed to buy as much gasoline as their tanks would hold. In addition, Conner's crew of eight attendants had a party.

"We are about to close and have a catered lunch -- wine, beer, roast beef and potato salad," Conner confided. He smiled, even as it began to rain.

"It's [the food and drink] from one of our good customers. He's been doing this for us every Fourth of July since the Arab embargo in 1973."

Evening Operations Today

Here is a list of gasoline stations in the District of Columbia that a city energy official said will sell gasoline between 7 p.m. and 9 p.m. today and Friday.

Pennsylvania Avenue Gulf, 2300 Pennsylvania Ave. SE; Hilcrest Shell, 2721 Naylor Rd. SE; Bill's Gulf Servicenter, 5120 Georgia Ave, N.W.; Jamison's Sunoco, 1253 Ninth St. NW; Melby's Gulf, 3124 Mount Pleasant St. NW; MacArthur Service Center Amoco Station, 5101 MacArthur Blvd. NW; Parkway Shell, 1944 Bladensburg Rd. NE, and Webb's Exxon Servicenter, 4100 Hunt Pl. NE.

Telephone Help

Following are telephone numbers of agencies providing information to deal with gasoline emergencies:

District of Columbia mayor's command center: 727-6161. An official said it will be staffed from 9 a.m. to 8 p.m.

Prince George's County "hot line" 779-1151. An official said it would be staffed around the clock.

Anne Arundel County "hot line" 263-2681. An official said it would be staffed from 6 a.m. to 9 p.m. daily.

American Automobile Association: 222-5000. Officials said AAA members may obtain small quantities of gas or be towed to a nearby station if they are stranded.

New Flag System

Washington area service stations have been asked to display special flags, noting the availability of gasoline.

A green flag means leaded and unleaded gasoline are available.

A yellow flag means only leaded gasoline can be purchased.

A red flag means a station's pumps are closed.

Gasoline station owners in the District of Columbia can pick up flags at the Munsey Building, 1329 E. St. NW, Room 1258.