How long do people on average have to stay on a machine after a cardiac bypass surgery?

4hrs. 4 to 6 hrs on the ventilator machines after bypass.
0-12 hours. Depends on the institution, surgeon, operation, condition of the lungs prior to surgery but most hospitals extubate patients before they wake up or within the first few hours in the intensive care unit.