The Metro system plans to operate longer trains on the Orange Line to ease crowding and accommodate more passengers after the line is extended to Fairfax County's Vienna terminus in June, transit officials said yesterday.

The transit authority also announced plans to reduce crowding on the Red Line, and officials set July 6 for the start of a long-debated extension of Sunday evening service. The rail system will stay open on Sundays until midnight instead of 6 p.m.

Crowding has increased as subway ridership climbed to record levels, currently exceeding 450,000 trips a day. Ridership is expected to rise by about 20,000 trips a day after the extension opens. "Right now, we have a problem," said Fady P. Bassily, Metro's assistant general manager for rail service.

The Orange Line shifts are designed to prepare for the June 7 opening of the nine-mile extension to Vienna. Most Orange Line trains now consist of four cars. Starting May 18, Bassily said, the Orange Line will switch to six-car trains.

After June 7, Bassily said, Metro is prepared to provide additional trains if crowding occurs. These trains probably would be dispatched around 7:30 a.m. and 5:30 p.m., when ridership is heaviest. Orange Line trains normally operate every six minutes at rush hours and every 12 minutes at other times.

On the Red Line, Bassily said, steps will be taken to lessen crowding after rush hours, when service is reduced. Metro soon will temporarily replace several four-car trains with six-car trains. In July, trains will start operating every seven minutes, instead of eight minutes, after rush hours.

The plan to extend Sunday service to midnight was included in a $456 million operating budget, which received final approval by the authority's board of directors yesterday. The budget for Metro's next fiscal year, which starts July 1, is designed to hold the line on fares.

Because of moves by the Reagan administration to halt federal operating subsidies for mass transit, the board voted to draw up a contingency plan. Officials said this plan may call for cuts in service or a fare increase. Metro receives $18.5 million a year in federal operating aid.

In another development, LaMar A. Dotter, 49, a Metro official since 1975, was named to the $72,900-a-year post of budget director.