Depends on the size, 1/4" I would say 8 max, 1/2" 5 fish, 1" 4 fish and up to 3" 2 fish.
Goldfish eat a lot and the water seems to get filthy fast compaired to tropical. They love to rearrange the bottom rock and rip ups pants, uproot them, and they tend to eat them. They're also notorious for knocking over decorations or picking up the bottom gravel and spitting it into the decorations to bury them if you like bubblers or some kind of air decoration Iike the diver etc.
If you get too many fish in the tank they stress and come down with many illnesses, you can put in helper fish to clean the bottom The catfish or algae eaters would work with goldfish, they help clean up the foods the fish miss or can't fit in areas to eat.