A list of crimes are written under section 212(a) of the Immigration and Nationality Act or 8 USC § 1182(a), which are deemed as grounds of inadmissibility.
Multiple Criminal Conviction
Traffickers in persons
Controlled Substances Crime
Prostitution and Commercialized Vice
When you apply for a US visa, you must answer about your past conviction or arrest for a crime, if any.
It is not a golden rule that you will become inadmissible for obtaining a visa once you commit a crime. For certain crimes, you can request a waiver, i.e., legal forgiveness for your crime.