UNITED NATIONS (AP) _ The 41st General Assembly closed Monday with outgoing President Humayun Rasheed Choudhury urging the United Nations to close the gap between rich and poor and to achieve global disarmament.

The 42nd General Assembly convenes Tuesday, and it is expected to choose as president Peter Florin, East Germany's deputy foreign minister.

Choudhury, the foreign minister of Bangladesh, presided over the one-day closing session of the 41st General Assembly.

''While some countries continue in their opulence, there are others in whom the pangs of poverty instill a numbing sense of despair,'' said Choudhury, whose country is among the world's poorest. He said nations must work together to close the economic gap.

Many people fear the planet has become ''an Armageddon of horror and destruction,'' he said. But he said he was optimistic about recent movement toward arms control, including U.S.-Soviet work on a treaty to eliminate intermediate nuclear missiles.

This year's session begins while the United Nations is under particularly close watch because of Secretary-General Javier Perez de Cuellar's bid to end the 7-year-old Iran-Iraq war.

The U.N. chief arrived in Tehran on Friday and flew to Baghdad on Sunday. He is scheduled to return to New York and report Wednesday to the 15-nation Security Council.

''It is our fervent prayer that his journey is fruitful and that this sad episode in human history is finally concluded,'' Choudhury said in his closing speech.

Perez de Cuellar is trying to get Iraq and Iran to comply with the Security Council's July 20 resolution demanding a cease-fire, a return to internationally recognized borders and an exchange of war prisoners.

Iranian President Ali Khamenei, in a rare visit to the United States, is to address the General Assembly on Sept. 22. The United States does not maintain diplomatic relations with the Tehran government.

In other action Monday, the General Assembly and Security Council, meeting separately, voted to elect Gilbert Guillaume of France to complete a term on the International Court of Justice.

The vacancy on the court, which sits at The Hague, Netherlands, was created by the March 10 death of Guy Ladreit de Lacharriere, also of France. Guillaume will complete de Lacharriere's nine-year term, which expires in February 1991.