there may be a few other things it might be, but from my experience, it sounds like it could be your igniter is going out on you (its inside your distributor). when mine was going out, my engine would die every few days, whether i was stopped or not.
I had a similar problem as rixXxceboy, my car never actualy shut off or stoped running. but it would skip or misfire. was an intermitttent problem for a few months, and the cause of it ended up being my ignition module in the distributor.