Aquarium goldfish can go for up to 2 weeks without eating. It is generally best to feed a few times a day, giving only as much food as the fish can eat in about 2 minutes.
Goldfish are omnivores and are surprisingly hearty when it comes not getting enough food. A healthy, well-fed aquarium goldfish could last 2 weeks without a feeding. However, most fish owners wouldn't want to put their pets through that stress without good reason.
The problem is that goldfish will keep eating as long as they have food available, and it is common for owners to put more food in the tank than the fish are capable of eating. As a result, the water quality goes down, and the fish eat until they get sick. It is best if fish are fed two to three times a day. It is even better if a feeding day is skipped once or twice a week, which helps improve the water quality in the tank.
If going on vacation, people can leave fish without feeding them safely for a few days without stressing them too much. If the temperature is going down, don't feed the fish at all below a water temperature of about 46 degrees Fahrenheit as they cannot properly digest their food.