Mexican President Jose Lopez Portillo arrives at the White House today for a two-day meeting with President Reagan that a senior administration official said will center on discussions of trade, energy, immigration and the continuing bloodshed in Central America.

Reagan has made closer relations with neighboring Mexico and Canada an important part of his foreign policy, and the two presidents are expected to consider a future trilateral meeting with Canadian Prime Minister Piere Elliott Trudeau.

Lopez Portillo, who arrived here last night, also will formally invite Reagan to the October summit on the Third World's economic problems to be held in Cancun, Mexico, and Reagan will accept, on the condition that Cuban President Fidel Castro not be invited, a White House official said. The summit will be attended by leaders of 22 industrialized and underdeveloped nations.

Reagans's first foreign trip as president was to Canada, and he met with Lopez Portillo in the Mexican border city of Juarez last Jan. 5, making the Mexican president the first foreign leader Reagan saw after becoming president-elect.

Reagan and Lopez Portillo were scheduled to meet again in late April, but Reagan postponed the meeting because he ws recovering from the bullet wound suffered in the attempt on his life March 30.

In a demonstration of the personl friendship Reagan feels for Lopez Portillo, who shares his interest in horses, Reaganis taking the Mexican president to Camp David to give the visit a relaxed, intimate tone. A barbecue tonight at Camp David's Aspen Lodge will replace the usual state dinner, although there will be a White House state luncheon Tuesday, after the presidents return to Washington.

Trade will be high on the agenda. Mexico is now the third-largest trading partner for the United States, a senior administration official told reporters at the White House. The official, who spoke on condition he not be named, said U.S.-Mexican trade totaled $27.5 billion in 1980.

The official said Reagan wants to hear Lopez Portillo's ideas on immigration problems. Reagan has expressed interest in a policy that would permit Mexicans to cross the border legally for specified periods to take jobs that employers have trouble finding Americans to fill.

Several politicians from U.S. border states have backed such a proposal, and Sen. Harrison H. Schmitt (R-N.M.) has introduced a bill that would regularize such border crossings by "guest workers."

Reagan and Lopez Portillo take different stands on the conflict in El Salvador between the junta supported by the United States and rebels seeking its overthrow.

Mexico has opposed outside intervention while the United States has stepped up its economic and military aid to the Salvadoran government. The senior administration official said the two presidents would take the opportunity to discuss problems in El Salvador and other nations of Central America.

Reagan also will discus with Lopez Portillo the United States' new "Caribbean basin" approach to foreign policy in the region, the official said. "

Mexico and Venezuela already provide oil at leass than market price to the developing nations of the region, the senior official said. The Reagan administration looks to Mexico and Venezuela to play prominent regional roles, he added, and Mexico's influence in the area is an additional reason Reagan considers good relations with Mexico an important part of U.S. foreign policy.

Lopez Portillo is expected to return to Mexico Tuesday afternoon.