The federal government's experiment with flexitime, set to expire Monday, got a new lease on life yesterday when the House adopted a measure that gives employe unions and the Reagan administration four more months to find a compromise on a permanent program.

The legislation, already passed by the Senate, was approved easily by the House after the Office of Personnel Management, under attack from both Democratic and Republican leaders, reversed its opposition to the extension.

OPM has been insisting on greater management control over the starting and stopping of flexitime programs, alternate working schedules that permit employes to compress or stagger their hours on the job. Unions, particularly the American Federation of Government Employees, have been pushing for safeguards on worker opportunities to participate in such programs. The two parties have been at an impasse for weeks.

Under the three-year experiment that was to have ended March 29, about a half-million federal workers are on four-day week or staggered work schedules. In the Washington area, more than 75,000 employes are on some form of flexitime and had worried that many of their programs would be terminated next month unless Congress acted.

Reflecting those and other constituent concerns, Northern Virginia Rep. Stanford Parris, a Republican, called a news conference yesterday and pronounced OPM director Donald Devine "an idiot" for opposing the extension of flexitime.

But Parris, who faces a tough reelection bid this year, had barely concluded his anti-Devine blast when a Republican aide rushed up to inform him that OPM had reversed itself.

Adapting quickly, Parris observed, "It apparently takes a great deal of time for sound to travel in this town, and I'm delighted Mr. Devine's ears have perked up."

OPM spokesman Pat Korten said later that Devine supports flexitime and had worked hard to find a compromise with the unions. He said the agency initially opposed the extension, believing it could negotiate more acceptable permanent legislation in the face of next Monday's deadline.

A Parris aide and union spokesmen countered, however, that OPM didn't back off its opposition until it was clear the House was going to approve the extension. The Senate had unanimously passed the extension bill, sponsored by Sen. Ted Stevens (R-Alaska), late Monday night.

A spokesman for the National Treasury Employees Union, calling flexitime a high priority, said yesterday that unions still hope to reach a compromise with Congress that would establish such programs on a permanent basis.