Hundreds of opponents of Iran's Ayatollah Ruhollah Khomeini, chanting slogans and carrying placards, gathered in front of the White House yesterday to mark the fifth anniversary of the day Khomeini's guards opened fire on 500,000 demonstrators in Tehran.

The protest, sponsored by the supporters of People's Mujaheddin of Iran to commemorate the "Day of Martyrs," began at Lafayette Park and continued with a noontime march through downtown. Organizers said more than 3,000 persons marched, but police estimated the crowd at 1,750.

Yesterday's demonstration came two weeks after Khomeini opponent Massoud Rajavi ended a five-year exile in France by flying to Baghdad to join resistance forces based on Iran's borders. Some have suggested that France, hoping to improve relations with Iran, asked Rajavi to leave.

Iranian exiles throughout the country attended the demonstration. A man who identified himself as F. Danesh and said he came from Chicago told of being jailed and tortured by the regime. "I carry scars on my body from these days, and nightmares wake me up from my sleep," he said.

Protesters who said they were relatives of Iranians executed by the regime stood before enlarged photographs of Rajavi and his wife and condemned the torture and executions.

Amnesty International puts the number of executions at 6,108 under Khomeini's rule, but says thousands more may have been killed. The Mujaheddin claims that 50,000 have been executed and 140,000 imprisoned since June 1981.

The State Department, in a report to Congress last year, described the Mujaheddin as a "militantly Islamic, antidemocratic, anti-American and antiwestern collectivist organization which employs terrorism."

Ali Safavi, a spokesman for the Mujaheddin here, disputed that charge. "Mujaheddin is a progressive, Islamic, democratic movement and we are not leftist," he said. "We seek mutual relations with all the countries in the world on the basis of recognition of Iran's national sovereignty and territorial integrity."