According to INA 212(a)(9)(B), an alien who is unlawfully present for more than 180 days during a single stay in the US, and then departs the US, is banned from the US for 3 years. If they were unlawfully present for more than 1 year during a single stay and then departed the US, they are banned for 10 years.
According to INA 212(a)(2) and INA 237(a)(2), conviction of certain crimes renders an alien inadmissible or deportable. However, there is no general rule that aliens who have been convicted of felonies are deportable or inadmissible. It depends on the specific type of crime. For example, DUI can sometimes be a felony, but is generally not a crime involving moral turpitude unless there are aggravating circumstances. Thus, an alien who is lawfully admitted for permanent residence may be convicted of certain crimes such as DUI and may potentially be imprisoned for over a year without facing any immigration consequences.
However, if the alien is a nonimmigrant, their status may expire while they are in prison. This would seem to cause them to become unlawfully present, potentially for a long period of time. Being incarcerated, they could not depart the US in order to stop the accrual of unlawful presence. They also most likely wouldn't have any basis to apply for an immigration benefit that would help them maintain their status. Upon release, they might be deported, but there's no guarantee of that happening; they might also leave the US voluntarily. I wonder if they would then be subject to a 3- or 10-year bar on account of their unlawful presence while being unable to leave?