After five months of negotiations that several times appeared on the verge of collapse, a group of House Senate energy conferees agreed yesterday on a plan to remove price controls gradually from newly discovered natural gas.

The federal controls would be removed by the end of 1984, subject to reimposition for one 18-month period if prices rise too high. This compares with President Carter's request to continue price regulation at higher levels, which the House approved, and with the Senate's vote to end controls after two years.

Conference staff members said the cost ot consumers would be about $12 billion to $15 billion more than under present law by 1985. it would be about an even split between the House and Senate versions of the bill, they said. The administration had estimated that deregulation would cost consumers $70 billion more than present law by 1985.

The agreement does not assure that the plan will be approved by the full conference and by Congress, or that its approval would break the stalemate that has held Carter's entire energy package - including taxes - stuck in Congress for a year and a day. But it was an essential first step to getting anything done.

The agreement was hammered out by about a dozen of the 42 conferees appointed last fall to resolve wide differences between House and Senate versions of the bill. They held a marathon meeting Thursday ending at 3 a.m. yesterday, trying to settle the issue on the bill's first birthday, then recessed for eight hours and wound up their closed session work with a burst of applause at 1:30 p.m. Secretary of Energy James Schlesinger met with them and served an important role as mediator, members said.

The agreement will be put to a formal meeting of the House-Senate conference next week, and the vote may be close. Sen. Henry M. Jackson (D-Wash.), leader of Senate conferees and backer of the president's position, and fashioned a 10-to-7 majority behind a gradual deregulation plan last month. But Sen. Bennett Johnston (D-La.), one of the majority, expressed dissatisfaction with some provisions when he left the conference early to catch a plane. House conferees had voted 13 to 12 last month for a proposal that was further modified by the small group of conferees at their closed sessions.

Jackson said the agreement "strikes a fair balance between the interests of natural gas producers and consumers." He noted that Congress had wrestled with natural gas pricing for a generation, since the Supreme Court ruled in 1954 that regulation was authorized by an act of Congress, and has never been able to agree on a solution.

Rep. John Dingell (D-Mich.), a staunch supporter of regulation, said he would try to sell the compromise to other House conferees.

According to one House staffer, the agreement is still extremely fragile and depends on such "swing" voters among the House conferees as Reps. Henry Reuss (D-Wis.) and James Corman (D-Calif.).

"What we're really trying to do now is keep that 13-to-12 majority," this source said. Reuss and Corman disaffection could spoil it.

Pete Domenici (N.M.), one of three Senate Republicans who joined Jackson in supporting the gradual deregulation plan, said neither president.House nor Senate got its way in the compromise and the result was "probably a package good for consumer and producer alike."

The price of gas is a big-buck issue. Industry contends deregulations is needed to assure adequate supplies of this efficient and widely used fuel. The administration contended industry would do very well under Carter's plan, which would raise the price ceiling for new gas from $1.49 per thousand cubic feet (mcf) to $1.75 per mcf and let it rise annually with inflation.

The agreement announced yeaterday provides an annual escalator in the new gas price ceiling which would be about 10 percent a year if inflation continues at 6 percent.

That means the present ceiling of $1.49 per mcf would immediately rise to $1.93, which is Carter's $1.75 plus the escalator for the past year. By 1985, when controls are to end, the annual increases would have pushed the ceiling for new gas up to $4.05 per mcf, compared to $3.44 per mcf in Carter's proposal, staff said.

Once controls on new gas end on Jan. 1, 1985, they must remain off for at least six months. Then at any time during the next two years, either president or Congress could reimpose controls if they felt prices had risen too high. A vote of both chambers could reimpose controls and also could veto the president's action reimposing controls. Controls could not extend beyond the end of 1988.

New onshore gas eligible for eventual deregulation would be gas from wells at least 2 1/2 miles away from or 1000 feet deeper than existing wells, and also from wells within this cylinder if it can be shown they are new resevoirs.

Gas from new offshore leases would be deregulated, but new reservoirs on old offshore leases, such as the Baltimore canyon off the Atlantic coast, would never be deregulated though eligible for escalator increases.

Old gas from existing reservoirs would remain under controls.

Price controls would be removed in one year from high cost gas, including gas discovered in wells deeper than 15,000 feet, Devonian shale, methane gas in coal seams and geopressurized brine.

Conferees agreed to the principle of incremental pricing, though some details remain to be worked out, to protect residential and other non-industrial users from increases until the price of gas reaches the level of alternative fuel such as heating fuel. Until then, industrial consumers would bear the price increases.

Several observers suggested that this could stir the opposition of such influential lobbies as the Business Roundtable if and when the agreement reaches the Senate floor.

"Incremental pricing, by statue, is the biggest thing the Senate had to give up," a congressional aide said. "Bit business won't like it."

Others expected to be disappointed by the compromise, staffers said, include Tenneco and El Paso Natural Gas. which have import applications for liquefied natural gas pending. Senate conferees reportedly wanted to exempt such prospective imports from incremental price increases, but House members refused.

One of the last issues dividing conferees was whether increases in a state's severance (sales) tax on gas could be passed on to consumers, as at present, or must be absorbed by producers. The conferees, over Johnson's opposition, agreed that producers could not pass on any part of the tax higher than the present highest severance tax, Texas' 7 1/2 percent.

The American Gas Association, which represents pipeline companies rather than producers, hailed the agreement as a "crucial step toward creating a secure energy future for America."

But James Flug, director of the consumer lobbying group Energy Action, said, "This is a surrender, not a compromise. The battle does not end here, it resumes here because the American people will not stand for this $50 billion gift to gas producers at the public expense."