How do you know that your heart stops beating? There are other things that can make you pass out like.... low blood sugar. But if your heart stopped beating...you would never know unless it happens while you're attached to a monitor. You need to see your doctor regarding this and find the cause.
Anxiety and panic will NOT make your heart stop or make you stop breathing, no matter how scary the sensations feel. There would have to be a very serious underlying heart condition to cause your heart to stop, and in almost all cases, you would have symptoms that something was wrong.
Are you having problems with anxiety that we can help with?