It's probably being deprived of oxygen because high levels of Ammonia are burning it's gills away. It's at the surface because gulping air is the last resort to get oxygen. Having it in a bowl will guarantee this to happen every time. Bowls are truly not meant for fish, but some how they are on the market.
Goldfish poop a whole lot and that poop turns into Ammonia when it decomposes. There is no way of escaping that fact, but there is a way to alleviate this by getting the proper sized tank, double filtration and to cycle the tank prior to getting fish.
I suggest that you change 90% of the water immediately to dilute the Ammonia and do this every day until you can get an actual fish tank with double filtration. Use a water conditioner always before allowing it to touch the fish and make sure the water temperature is the same as the bowl water was.
Please read up on the Nitrogen Cycle and Goldfish care. Knowing what type of goldfish you have can help you figure out what size tank it truly needs.