If you have panic attacks from a diagnosed panic disorder, then the panic attacks will most likely last a long time. Even if you recover from panic disorder, then you will most likely have another future panic attack, as panic disorder has a high rate of relapse (Hirschfeld, 1996).
On the other hand, if you have panic attacks that are induced by stressors, then the panic attacks will go away if you address your stressors. Panic attacks that are induced by stressors are really anxiety attacks. The main difference is that panic attacks occur spontaneously, randomly, out of the blue, and do not have an obvious stressor, whereas anxiety attacks are triggered by a stressor.
The good news is that if you engage in treatment for panic disorder, or if you address your stressors, then your panic attacks will go away. But they will not go away on their own. You need to be active in seeking treatment and reducing your stressors in order for the panic attacks to go away.