How often you feed your goldfish will depend on various factors. A general guideline for feeding is providing them with enough food that they can consume in two minutes (with the exception of veggies which take much longer to digest). Feeding too frequently could clog up their filter system and lead to overcrowding or waste accumulation in their tank, and harm them as a result.
The amount of food you should provide your goldfish depends on their diet type. Goldfish fed flakes or pellets should only be fed twice per day or less as these rich foods can lead to problems, including swim bladder disorder in fancy varieties. It can also lead to constipation, food impaction in their digestive tract and even lead to fatty liver disease - manifesting in cloudy spots on their fins that is typically caused by stress, poor water quality or eating too much food.
Goldfish that are fed a balanced, low-fat ration can be fed up to three times per day for optimal weight management and avoid overfeeding. As they age or require extra food for growth, the frequency of feedings should decrease accordingly. In cooler months it is advisable for outdoor hibernators fish that will only need food once or twice per week as their metabolism slows down considerably and their metabolism cannot process as much food at once.