In what would be a dramatic reversal of its conservative energy policy, Mexico is planning to double its oil production to about 4 million barrels a day by the end of 1982, according to diplomatic and oil industry sources here and in the United States.

The projected increase would make Mexico, which is not a member of the Organization of Petroleum Exporting Countries, as large a producer as any OPEC nation except Saudi Arabia if present levels of production are maintained.

Mexico's planned increase runs against the current trend among oil-exporting countries that generally have been considering cutbacks. Saudi Arabia, for instance, was once thought capable of producing 20 million barrels a day by 1985, but has held its production to about 9.5 million.

A production increase by Mexico at such a time has far-reachng implications not only for the United States and other Western consuming nations, but for economic, social and political developments here as well.

Mexican President Jose Lopez Portillo has said repeatedly that Mexico would limit its oil production in accordance with national capacity to absorb and invest the massive income it generates. In the past, he has said production levels would therefore not exceed 2.25 million barrels a day by the end of his term in 1982.

Mexicans regard their oil as a national treasure to be husbanded. It is the focus of tremendous patriotic sentiment and political passion.

In what many observers consider an effort by Lopez Portillo to test the political currents before making a formal announcement of the production increase, reports leaked to Mexican newspapers quoted official sources a week ago as saying the president had made the decision to produce nearly 4 million barrels a day by the end of his term.

A spokesman for Pemex, the state oil company, would neither confirm or deny that the president had made such a decision. The president's spokesman would not comment.

Diplomats and sources close to the oil industry in Mexico, however, said they believe the decision already has been made, and is based on government assessments of increased cash needs for development and service of Mexico's massive debt.

A senior U.S. official in Washington said that "Pemex doesn't want to make an announcement right now because of the political problems . . . but Mexico will probably be producing 4 million barrels by the end of 1982.

There have been several indications already of moves toward large production increases. The Pemex budget unexpectedly shot up 84 percent over last year and current projections show that Mexico will reach the 2.25 million barrel a day target by this coming April, more than six months ahead of the old schedule.

Pemex production capacity has grown dramatically, more than doubling since 1976, and experts say it can comfortably handle the 4 million barrels a day by 1982, with earlier production bottlenecks slowly clearing up. Pemex estimates proven combined oil and natural gas reserves at 45.8 billion barrels. Of this, CIA estimates place Mexico's oil reserves at about 15 billion barrels.

Mexican oil production this month reached a record 1.9 million barrels a day, of which 1.2 million are used domestically and about 700,000 are exported. dClose to 80 percent of the export oil currently goes to the United States.

As Middle Eastern sources of supply have looked increasingly threatened, Mexico has been courted heavily by consumers as diverse as Japan, Britain, Finland, West Germany, Bulgaria and Romania. Pemex now holds letters of intent from eager customers for a total of 4 million barrels a day.

U.S. analysts and officials, however, generally have taken Lopez Portillo's lead and considered that Mexico could not be counted to increase greatly its oil exports to relieve the pressures of declining and sometimes uncetain OPEC production.

U.S. officials still emphasize that large increases in Mexican production would not come close to eliminating problems with world supply, but if Mexican exports rise in proportion to its production increase, the difficulties could be eased.

Prices, which Mexico maintains at or above OPEC levels for its exports, would be largely unaffected.

An increase of a million or more barrels a day on the world market, particularly of oil produced in this hemisphere, would not be a "cornucopia," one U.S. energy official said, but "it would be good news."

If Pemex does follow through with the plans to step up production, however, the decision undoubtedly will stem from doemstic pressures rather than international demand.

Oil and gas revenues for 1980, at current or slightly increased production levels, have been projected at between $8 billion and $10 billion.

Mexico's dramatic social problems demand vast government investment in coming years, however, and the country continues to have a tremendous need for cash.

The $7 billion it required in 1979 just to service its $30 billion foreign debt is an indication of its hunger for additional revenues.

While Mexico had expected to reduce its budget deficit drastically last year as oil funds started coming in, it now finds itself with its largest current accounts deficit ever -- a staggering $3.5 billion.

As it bought capital goods to enable industry to expand meanwhile, its imports increased by 44 percent.

Mexico oil earns it cash only when it is exported. At home, Pemex keeps oil and gas prices much lower than the international norm and unofficial estimates suggest that every barrel of oil Pemex sells at home costs the government $20.

In what some observers believe is an effort to soften public criticism of the resource's increased exploitation, Pemex officials have been giving increasingly optimistic interviews recently about the rate and importance of new discoveries.

Mexico's proven and probable oil reserves have already been estimated by Central Intelligence Agency and U.S. Energy Department analysts at more than 1-1/2 times those of the United States.

Earlier this month Pemex announced that a new oil field in the southeastern part of the country holds aother 1.5 billion barrels and the giant offshore wells in the Gulf of Campeche are even larger than the predicted 11 billion barrels.

Nevertheless, criticism of the government's plans -- after stories about them appeared in Mexican newspapers -- was heavy. One political columnist wrote that "raising the production platform this way is equivalent to putting our oil fields up for public auction."