With U.S.-Mexican relations entering a particularly crucial period, President Carter has decided to replace Partick J. Lucey, the controversaial U.S. ambassador to Mexico, administration officials said yesterday.

The officials said Lucey was being recalled to strenghten relations between the United States and Mexico, which have been cool almost since Carter named the former Wisconsin governor to the post in July 1977. Lucey, who does not speak Spanish and who had no prior diplomatic experience, has been criticized in Mexican as well as U.S. quarters on the grounds that he is uninformed on Mexican politics and insensitive to some of the country's problems.

One senior White House official insisted, however, that there was no dissatisfaction with Lucey's record as ambassador and that he probably would return to Washington to a soon-to-be-created post of ambassador-at-large to coordinate eight task forces working on U.S.-Mexican relations.

"If there was any dissatisfaction, he wouldn't be coming back in that position," the official said.

As coordinator of the task forces, Lucey would be based here, and thus subject to closer White House supervision.

Any irritant to U.S.-Mexican relations is considered critical at this time because the two nations are in the process of reaching long-term policy decisions on the future of Mexico's enormous new reserves of oil and natural gas, as well as the problem of illegal Mexican aliens.

Carter was said to be still searching for a successor to Lucey. According to a White House source, Lucey is scheduled to return to this country soon, within "two to three months at the outside."

The decision to replace Lucey will be welcomed by elements of the Mexican press and some officials who have been critical of the ambassador and who felt the post should have gone to a career diplomat who speaks Spanish.

Lucey also has been accused by some career diplomats of using his ambassadorial post to further domestic political ambitions and criticized by U.S. business leaders in Mexico City who said he failed to engage in an interchange of information essential to business operations in that country.

"He didn't seem to be interested in anything that didn't promote his political ambitions back in the United States or give him personal brownie points with the White House," a former diplomat who served with Lucey in the embassy told the Times yesterday.

Despite the criticism, Carter has publicly expressed confidence in Lucey, and Secretary of State Cyrus R. Vance recommended that the President name Lucey to the ambassador-at-large post.

In that position Lucey would coordinate the efforts of task forces on energy, trade, immigration, security and other issues. The task forces would work with comparable Mexican units.

State Department officials hope that if Lucey gets the ambassador-at-large post he will return to Washington "as soon as possible" because of the crucial nature of upcoming negotiations with Mexico on the purchase of natural gas and other energy sources from the oil-rich country.

Carter's advisers are not unanimous in supporting Lucey for the post, although those who do not are reluctant to discuss the issue because it is so politically sensitive. One presidential adviser, however, told the Times he thought it would be poltically damageing for the president to appoint Lucey to another post dealing with Mexican relations.

"He was a disaster in Mexico City so it doesn't make sense to bring him here to deal with Mexican problems," this adviser said.

Although Lucey reportedly received relatively low marks in an offical White House review of his record as ambassador, several officials insisted that Carter and Vice President Mondale have been satisfied with his performance.

"He's a good man and we don't want to lose him; we want to keep him," said a member of Mondale's staff.

The vice president strongly recommended Lucey for the Mexican post.

The decision to recall Lucey to Washington was not made until after Carter's visit to Mexico Feb. 14-16. White House sources said the cool reception Carter received from President Jose Lopez Portillo in Mexico City was not a factor in the decision.