This sounds like a throttle position sensor, or a massive air leak after the mass airflow sensor. This has surly set off the check engine light. Retrieve the code and look it up to see what is giving the engine such a fit.
Check any codes, but if there are none, locate and replace the throttle position sensor. I did this in Cavaliers and Grand Am. Look at air filter also - a sign of a clogged one?
I would start by looking for a vacuum leak. Then I would look for a fuel leak in the fuel lines. If the lines are leaking, at low idle, it will suck enough air to stall, where as at high rpms it will still have enough fuel to run.
that sounds like a vacuum leak or fuel problems, change the gas filter and once its idling, spray some carb. cleaner or starting fluid around the fittings and the intake gasket.