Seconds to minutes unless the stabbing instrument is still embedded in the heart or if one of the atria got stabbed, if it was a ventricle death can be immediate.
There are numerous factors in this. What is being used to stab you? What level of health do you have? Where exactly is the heart stabbed? How often do you get stabbed? How many of the heart’s chambers are damaged?
Does the pericardium permit blood to leave or does it keep it in, resulting in a tamponade (which prevents the heart from filling due to pressure outside the heart)? What did the weapon leave inside or take out?
A large knife was used to totally pierce the heart. It was left there for nearly a minute before being immediately removed.
A small knife or screwdriver that completely penetrated the heart—if left in—pulled out a tamponade death in seconds. If the weapon is just in the left ventricle, you may survive to tell the tale; if the weapon is only in the right ventricle, or either auricle, you may survive; if the weapon is pulled out, you will die from a tamponade in a matter of seconds.
I was completely stabbed in the left ventricle with a 7″ long, 1″ wide blade, but I managed to survive because the knife was buried in my chest and an officer found me shortly after the attack. He had the skills to sustain me till the medical personnel arrived.
People do survive – but usually, because they get immediate help, are in good condition and the weapon is left in.