The D.C. government tentatively has agreed to a contract that would give about half the city's unionized employes 23 percent pay raises over the next three years and certain benefits never before provided.

In affluent Fairfax County, local government employes were told yesterday their pay raises will be limited to 5 percent next year, less than half the raises they got this year.

The D.C. contract agreement, hailed by both management and the unions involved, followed by a week the unprecedented agreement of a House-Senate conference committee to fund Mayor Marion Barry's full $336 million city budget request.

In Fairfax, fear over U.S. and state budget cutbacks dictated spending constraints. "I'm sure everyone would have hoped the contract tentatively agreed to by the County Board of Supervisors would be more," said County Executive J. Hamilton Lambert, "but I think when they're seeing RIFS and layoffs occurring, that certainly gives you pause to reflect."

The D.C. agreement, covering about 15,000 employes in six unions, calls for an immediate 3.5 percent bonus, guaranteed protection against layoffs through 1983 and a dental and health care plan.

This was the first time that city workers have been able to negotiate for compensation. Heretofore, they received the same pay increases and benefits given to federal workers.

"This has been a very enriching experience for us," said Geraldine P. Boykin, executive director of District of Columbia Council 20 of the American Federation of State, County and Municipal Employees. "We feel that it is a fair settlement and I feel confident that our membership will ratify it. We hope that the City Council will approve it."

The D.C. City Council has 60 days to approve the contract, which is expected to cost the city $69 million during the next three years. When the 1982 city budget was first formulated, District of Columbia officials said they had only $16.8 million set aside for salaries, enough for only a 2.5 percent raises for the first year -- compared to 5 percent in the new agreement. The contract also calls for a 7 percent raise next October and a 6-to-8 percent raise the following October, depending on the consumer price index.

"Because of skillful financial management by Mayor Barry and his entire financial management team, we have been able to arrive at this point today . . . " asserted Donald H. Weinberg, D.C. Director of Labor Relations and Collective Bargaining. "We have the resources for a tentative accord which is higher than pay increases granted to the federal employes this year, and higher than pay increases received by employes in many hard pressed urban centers."

The contract only addresses compensation issues, not working conditions, which are expected to be worked out over the next several weeks, according to Boykin.

The six unions covered by the agreement are AFSCME, the American Federation of Government Employees (AFGE), the Communication Workers of America (CWA), Laborers International, the National Association of Government Employees (NAGE) and the National Police and Security Officers Union.

Labor contracts are pending with firefighters, licensed practical nurses and registered nurses.

In Fairfax, where about 14,000 public employes are affected by the contract expected to be approved by county officials, the most vocal employe organization, the Fairfax Education Association Association, announced it is prepared to accept a pay increase substantially below the annual increase in the cost of living.

"In light of the 4.8 percent package for federal government employes, we think the 5 percent total salary adjustment plus step and additional fringes is a substantial settlement," said Patrice Gancie of the FEA.

Not all employe groups were satisfied. The president of the Fairfax County Federation of Teachers, which represents about 10 percent of the county's teachers accused the FEA, a long-time rival organization, of selling out by accepting the 5 percent pay raise. Michael Mitchell, FFT president, said the pay raise was "totally unfair and unreasonable." The FFT had recommended a 12.1 percent salary increase.

The bulk of the settlement -- $15.7 million -- will be allotted to teachers. In addition to the 5 percent pay increase for teachers, the county will pick up 1.8 percent of the employe retirement contributions and will provide partial payments for dental and vision care plans.

Both the School Board and the Board of Supervisors must vote on the pay and benefits package before it can be included in the budget for fiscal year 1983.