Given the information you provided, it's more than likely because you aren't feeding enough (or not the right foods). There seems to be no other reason he'd be top-surfing, (probably not gasping for air as you think, but rather, trying to skim off floating particles), but then be fine and dandy to retreat back to his hang-out once you feed him. Additionally, not being afflicted with any other condition, it wouldn't strike me as anything medical. And is it really only for an hour that he's content, or perhaps it just seems that way?
Have any of your water conditions changed, have you added any new stock, done anything different in ways of water changes, substrates, decor, etc? Nevertheless, if you fear he really is "gasping", lower the temp slighly so it can retain higher O2 levels, and increase circulation. Take note of swimming patters, socialization, and overall physical appearance of the animal so we can make certain it's not an infection/disease.
At this point im not too concerned since you make it sound like, other than surfing along the top until he's fed, he acts normally.
Try switching up his food, and bulking it up with heavier roughage to sustain him and provide a wider balance of nutrients.
He know's his tummy better than you, so a good rule of thumb, is to feed in small portions slowly - i.e start with a small amount, let him finish, then offer more, until he looses interest. This is a good way to make sure you don't overfeed as well, resulting in accumulated wastes in the tank.
Let us know if anything changes.