Well, without any descriptions on noises, or other symptoms, I would say it sounds like a vacuum system issue. Vacuum system issues tend to be most pronounced at idle when the vehicle's air intake isn't as rapid as when the vehicle is in motion. When there is a leak, or a hose is disconnected, or a sensor is bad etc, the ECM doesn't know how to regulate the air flow, and the result can sound like the car is suffocating to death, before it shuts off.
I suppose it could also be possible that your injectors are fouled up? If your fuel injectors have gone bad, it can result in a lack of fuel getting into the engine, which again, would suffocate the engine and it would die on you. Right off the top of my head, those are my initial suspects barring any more symptomatic descriptors.
I agree with Captainsolo that an OBD code read would do you some good. Although, you don't have to purchase one. You can always pop by an Advanced Auto Parts store, and ask to have your OBD code read. Sometimes they'll just hand you the device to handle it yourself (which always shocked me when it happened) — others — they'll insist on coming out to your car to read the code for you. Either way, the OBD codes will help point you in the direction you need to go.
The Toyota "Diagnostics+-+Engine.pdf" (which can be found easily on Google now days) has a great OBD codes chart and what they mean starting on page 14