MEXICO IS DISCOVERING, to its own astonishment, that is evidently has the resources to become the world's great oil producers. In the United States, this nation of optimists, a lot of people have immediately begun to assume that American dependence on Arab sources will now sharply decline and that any need for conservation had ended. Both conclusions are incorrect. The Mexican discoveries are greatly to be welcomed, both for Mexican's sake and for its future consumers'. Both the development of an increasing U.S.-Mexican trade in oil, on terms satisfactory on both sides of the border, is going to be a considerably test of American diplomatic skill.

The gigantic scale of the Mexican fields has only gradually become apparent. Pemex, the Mexican state oil monopoly, was highly conservative in the reports that it sent along to its government. As for the Mexican government, it felt no oblication to tell the world. But estimates have steadily risen over the past two years, and last month President Lopez Portillo announced figures that would put Mexico's potential production in a class with Saudis Arabia's. That kind of estimate is always speculative, but there is more than enough evidence to establish that these new reserves are extremely impressive.

Since Mexico has oil and the United States is ready to buy, there's a widespread tendency here to assume that it's just a matter of connecting the pipes. People who think that is som might usefully relect on the parallets between Mexico and Iraq, another country with very large reserves. The Iraqis have been expanding production over the past decade - but slowly and with the most extreme care not to allow any foreign company or customer any degree of influence in their oil policy. The rate at which Iraq sells oil is measured to its internal development requirements, not to the needs of its customers abroad. It would not be surprising if Mexico followed the Iraqi example.

Mexico was the first country to expropriate foreign oil operations, in 1938, and oil occupies a special place in the theory and practice of Mexican nationalism. But there are good economic reasons for Mexicans to think twice about moving rapidly to very high levels of production. The great central preoccupation of Mexican economic planning is the country's population growth rate, one of the highest in the world. Only 15 years ago there were 40 million Mexicans. Today there are 64 million, and by the end of the century there will be more than 120 million.

Working with the World Bank, the Mexican government is moving toward new development plans that emphazie agriculture and labor-intensive industries, to provide food and jobs. The government intends to use its oil revenues to finance this kind of expansion. Capital'intensive industry is likely to be deferred.

Certainly Mexico will sell its oil for no less than the world price. Unfortunately, the United States has badly mishandled the preliminary test case involving natural gas. The Mexicans offered gas at a price linked to the cost of heating oil. The U.S. government has refused to approve the sale, apparently out of fear that it might derail the extremely fragile compromise on the natural gas pricing bill now moving through Congress. Understandably, the Mexicans are offended to find their interests given second place to the Carter administration's transient political embarrassments. But there are more substantial differences ahead. Mexico has alreadly indicated that its attitute toward oil and gas sales will be affected by U.S. positions on issues like Mexican immigration and access to the U.S. market for Mexican agricultural and industrial products.

The American position in this kind of negotiation is not going to be a comfortable one. American oil consumption is still rising rapidly - more rapidly than Mexico is likely to expand oil production. The United States continues to be a buyer in a sellers' market.