The Carter administration announced yesterday that it will force all Iranians to leave the United States when their travel documents expire unless there are "compelling humanitarian reasons" for them to remain.

The announcement was the latest escalation of U.S. pressure on Iran, which has been holding American hostages in Tehran since Nov. 4.

It could affect tens of thousands of Iranians who may be in the United States as tourists, businessmen or temporary visitors, according to David Crosland, acting head of the Immigration and Naturalization Service.

However, 67,000 Iranian students holding U.S. visas are not affected by the announcement as long as they remain in school.

Previously, temporary visitors could have their travel documents extended routinely. Crosland said the new directive is "certainly tightening up current policy" in response to the five-month imprisonment of the American diplomats.

The announcement goes beyond the measures ordered by President Carter last week. Carter severed diplomatic relations with Iran, ordered the departure of 35 Iranian diplomats and 209 Iranian military personnel and their families and closed U.S. bordersto Iranians seeking entry except for "compelling and proven humanitarian reasons or where the national interest requires."

Carter's orders did not affect most of the 150,000 Iranians who hold valid U.S. visas. An undetermined number of those may have left this country, Crosland said.

Crosland said the government has no idea how many Iranians will apply for political or religious asylum or to remain for humanitarian reasons. Applications will be considered on a case-by-case basis, he said.

Iranians whose visas expire and who do not apply for special consideration will be sought out by the Immigration and Naturalization Service for deportation proceedings, Crosland said.

The new restrictions will make it more difficult for Iranians to apply for permanent residence, he added.

Effective immediately, extensions of travel documents will be granted only in these instances:

Where the Iranian asks for asylum based on "a fear of persecution based on ethnic origin, religious or politicalbeliefs."

Where the Iranian is a child, parent, brother or sister of a U.S. citizen, or is a spouse or unmarried child of a lawful permanent resident.

Where the applicant requires immediate medical attention.

"Most of those affected are tourists," said INS spokesman Vern Jervis. Most Iranian visitors to the United States enter this country on six-month visas, he said, but students have immigration forms that permit them to remain for as long as they are in school full-time.

Jervis said Iranian students who graduate in a profession that might be useful to the United States normally would be allowed to remain -- but will not be able to do so under the latest crackdown.

The State Department, meanwhile, has set up an interagency working group to process cases of Iranians who had been ordered to leave the country but had applied to remain under asylum or for humanitarian reasons.

A State Department spokesman said that "many" such requests have been received.

The orders could cause many personal problems for Iranians here. A petition to Carter from the students and faculty at Norwich University in Northfield, Vt., protested the "arbitrary deportation" of 85 Iranian naval cadets, saying that many had come beforethe Islamic revolution and had no ties to the current government.