Not quite synonyms. Gasping for breath, is what one does when one is acutely short of breath, ie after a run up a steep hill or if you dove too deep into some swimming hole, and your lungs where nearly busting before you could get to the surface so that when you did get to the surface you would be gasping for air. Panting, is a lot of regular fast breaths in and out, more commonly used to describe a dog panting.
New words, one handy idiom, and a 2-minute quiz — delivered to your inbox to keep your streak alive.