There is no charge to enter. But winners must pay several hundred dollars in fees.

In the spring, a government computer in Kentucky selects 100,000 entries for green card processing. At noon on May 15, millions of people around the world will click on the State Department website to find out if they are among them.

Even then, a visa is not guaranteed. Winners are interviewed, undergo background checks and medical exams. Many are eliminated for failing to meet requirements and deadlines.

Ultimately, 50,000 people — lottery winners, as well as spouses and minor children they want to bring over — are awarded visas, which entitle them to move to the United States as legal permanent residents, or green card holders. Like most others with green cards, they may apply for citizenship after five years.

Olsi Vrapi, an immigration attorney born in Albania, won the lottery in 2003 when he was on a student visa at University of New Mexico.

“Thanks to the green card lottery I was able to stay here, go to law school, marry my wife, have four beautiful children and build a law practice,” said Mr. Vrapi, whose Albuquerque-based firm has grown from two to 23 employees in four cities and four states.

During public remarks at a cabinet meeting on Wednesday, Mr. Trump said that Mr. Saipov was “the primary point of contact for — and this is preliminarily — 23 people that came in, or potentially came in with him.” Green card holders in the United States can sponsor immediate family members to receive their own green cards, but it was not immediately clear what the 23 number referred to.

Calls to End the Lottery

The program had been under scrutiny even before the terrorist attack.

Critics have long contended that the program poses security risks, brings in low-skilled immigrants and is unfair because it enables people with no connection to the United States to enter more easily than others.