The long-simmering dispute between Iran's hard-line Islamic revolutionary leadership and President Abol Hassan Bani-Sadr came to the Surface yesterday over government efforts to name a new foreign minister.

The quarrel between Bani-Sadr and Prime Minister Mohammed Ali Rajai was viewed with particular interest because the foreign minister, when he is named, could play an important role in negotiations with the United States for release of the 52 American hostages now into their second year of captivity.

It also dramatized once again the different and sometimes competing centers of power in Tehran that have a voice in deliberations on freeing the Americans. Any intensification of their struggle for influence could delay the indirect negotiations already under way between Tehran and Washington through third-country diplomats relaying messages.

The spirtual adviser to the Islamic revolutionaries actually holding the Americans warned, meanwhile, that delay could also result from the shift in American leadership caused by Ronald Reagan's victory over President Carter in the U.S. election.

"Because Carter was already in office, we would have reached a solution faster if he were reelected," the official Tehran radio quoted Hojatoleslam Moussavi Khoeini as saying. "With Reagan's victory, this will need a long time."

Khoeini explained, however, that in his assessment Reagan or Carter are equal evils in Iranian eyes and that the personality of the man in charge in Washington will have no effect on the hostage crisis. The delay could stem rather from hesitation in the Carter administration following its defeat at the polls, he said.

Rajai, echoing similar views, told the official Iranian news agency Pars that the U.S. elections should have no effect on the hostage negotiations.

"The conditions for release of the hostages are a law passed by parliament that has to do with our country," he was quoted as saying. "We don't care who is ruling in the U.S. government. These conditions were passed by the parliament and approved by the imam [Ayatollah Ruhollah Khomeini]."

Khoeini, who is deputy parliament speaker, also headed the special seven-man commission that drafted the conditions for release of the hostages approved Sunday by the full parliament, or Majlis. He is believed to enjoy special influence among the militant Islamic students who occupied the U.S. Embassy in Tehran on Nov. 4, 1979, and have held the American hostages ever since.

Rajai announced at a rally in tne embassy compound Tuesday that his government will take custody of the hostages. This is regarded as a key first step in their release, since it would for the first time give physical control over them to the authority doing the negotiating. There was no sign in Tehran, however, that Rajai has followed through on his declaration, wire services reported.

This was not seen as a sign the students refused to give up the hostages, however, because they pledged after a conversation with Khomeini to turn them over once parliament decides on the conditions for their release. Throughout the year-long hostage crisis, the students repeatedly have said they take orders only from Khomeini, the 80-year-old Shiite Moslem patriarch who is Iran's only undisputed leader.

Khomeini renewed his call for continued war with Iraq until all Iraqi forces are driven from Iranian soil during a speech yesterday marking the beginning Saturday of the Shiite holy month of Moharram. But he pointedly avoided mention of the hostage situation.

The wrangling between Rajai and Bani-Sadr emerged in a statement by Rajai to the Majlis in which the hardline prime minister said the relatively moderate president has rejected six nominations for foreign minister and now has before him a seventh. Rajai did not specify why his first six picks had been turned down. But observers concluded that Bani-Sadr was insisting on someone more akin to the moderate line he espouses, while Rajai was nominating representatives of the fundamentalist Islamic approach exemplified by his own policies.

"I discussed these six names with the imam the other day and the imam has positive ideas about some of them," Pars quoted Rajai as telling the assembled Majlis members today, and I anticipate that Mr. Bani-Sadr will agree to the nomination of this [seventh] person for the foreign minister at this crucial time."

Rajai's reference to Khomeini's "positive ideas" about some of his nominations was regarded as an attempt to outflank Bani-Sadr by conferring the imam's moral authority on Rajai's choices. It underscored the extent to which Khomeini remains the ultimate arbiter in Iran over and above the constitutional government set up since the fall of the late shah, Mohammad Reza Pahlavi.