The Mexican government yesterday agreed on terms for joining the international body that regulates world trade, the General Agreement on Tariffs and Trade, and GATT members immediately began voting on its membership.

The agreement was hailed by the Reagan administration, which cast the first vote in favor of Mexico's admission. By day's end, 15 other countries had voted in favor of Mexico and at least 30 more had indicated they would do so. A total of 61 countries have to give their approval for Mexico to become a full member of GATT.

"Mexico's accession to the GATT will begin a new page in our ever-expanding bilateral economic relationship. It forms a solid basis upon which we will continue to develop mutually beneficial trade relations," said U.S. Trade Representative Clayton Yeutter.

Mexico, the United States' third-largest trading partner, is the biggest free-market economy remaining outside the 91-nation GATT.

Joining the trade organization has been an emotionally charged political issue for Mexico. Some factions have said joining could lead to a loss of Mexico's sovereignty, but joining the trade agreement is a cornerstone of President Miguel de la Madrid's plan to rejuvenate his country's sagging economy.

Burdened with a foreign debt of about $100 billion, the Mexican economy has been battered in recent years by falling oil prices.

GATT's Council of Representatives, meeting in Geneva, also accepted the membership application of China. This is the first step in what are expected to be extremely complex negotiations to bring the largest Communist nation, whose economy is not driven by market forces, into GATT.

The negotiations leading to Mexico's becoming a full member of GATT -- a process de la Madrid wants to complete before a new round of global trade talks starts Sept. 15 -- took place during the past six months. De la Madrid formally applied for membership in November.

In order to join the world trade agreement, Mexico will have to dismantle some of its import barriers. But officials of the de la Madrid government say this will force Mexican companies to improve the quality of their products and to become more competitive in world markets. By exporting more, Mexico will become less dependent on oil income, the de la Madrid government believes.

Even with the trade concessions necessary for Mexico to join GATT, "What all this means is greater access for U.S. exporters in the Mexican market." -- Clayton Yeutter, U.S. trade representative Yeutter said, the agreement is "fair to the interests of all." It will provide protection from other countries' unfair trade practices and will give Mexico benefits that other developing countries get to help their economic growth.

To join GATT, Mexico agreed to the organization's codes involving licensing, customs validation, standards and antidumping, and to begin negotiations that will lead to an end of its subsidies. In addition, it agreed to lower its tariffs and specifically committed itself to provide greater access to its markets for other nations' products, including more than 200 that are of interest to the United States.

"What all this means is greater access for U.S. exporters in the Mexican market," Yeutter said.