I just purchased a Honda Civic 2000 and it shut off by itself?

Okay so I recently purchased a Honda Civic 2000 (1 week ago) has been driving smooth with no problems. I had it checked by my uncle who is a mechanic before I purchased it and he says the car s engine is in perfect condition, and i recently had it serviced at my local mechanic and he told me the engine is good and i had gotten quite a good deal with this car.
But yesterday in the middle of the afternoon when it was really hot i went outside to check something in my car i turned it on and put the air con on High the car was in park then after about 5 minutes the car just turned off. I wasn't too sure why so i let it rest and tried to turn it on again a few hours later and it turned on fine and this morning i had the battery checked by a mechanic and he said it had at least another 2 years worth of juice left.

BTW this is my first car and thats why I have no idea what's going on

Should i be worried with what happened yesterday?

Hi so you think a mechanic who works on cars has all the answers well no he does not. Since 1985 the motor car has become 50 % electronic in that it has at least two computers built into it's workings.
so now the guys are no longer just mechanics but technicians with training in diagnostics. The modern motor car has to be diagnosed with a diagnostic tester.
this piece of equipment is peculiar to just one make of car.
yours being a honda the honda diagnostic tester has software in it which is updated by honda on a monthly basis.
so when the engine warning light comes on the only place it is going to get fixed is a honda dealer. This state of affairs is how thing have been since 1990.
these of these scanner devices is usually a case of poke and no hope and usually ends with the owner paying out far more money than he needed to.
so just take it to a honda dealer to get it fixed. It should also be serviced by a honda agent if you want trouble free motoring.
Now i will give you one other piece of advice the modern motor car has a designed life of just 8 years beyond which it is living on borrowed time.
so sadly yours is well past that time scale. So it will become a money pit as well.

More then likely its your fuel pressure sensor, it might be failing causing your engine to think you arent getting any fuel causing the engine to cut off, now maybe you arent getting enough fuel or your sensor is bad, more then likely i would say sensor because i have had a couple of these on other imports go out, now before everyone on here starts shouting alternator they need to take the time to read that you never said you jumpstarted it after it died you just let it sit, if it were the alternator your battery would have been drained and wouldnt have started later. Now its always possible you have a bad ground on your battery, if after it died you messed with your battery cables you could have fixed the issue and just not realised it till later when you went to start it again, this is also very common.