When you have a community tank (a fish tank with multiple fish), you should try to avoid overcrowding it. If you put too many fish into a tank you could cause a lot of problems.
Here is what can happen in an overcrowded tank:
Ammonia and nitrite spikes. If a tank is overcrowded there will be so much ammonia, that the bacteria cannot handle it all, and the ammonia and possibly nitrite levels will spike and cause your fish to become sick or even die.
A dirty tank! With so much fish waste in the tank because there are too many fish, the tank will get dirty much quicker.
Aggression between fish. Fish can be territorial. If they do not have enough space they can become aggressive towards each other and there will be fin nipping and injuries. So if you put too many fish in a tank, tensions will get high and their will be fish fights!
Growth problems. If a tank is too crowded, some fish may not be able to grow to their maximum size. This can be a problem because while the body stops growing there is a possibility that the organs in the fish will continue to grow and eventually it will kill the fish.
So here is how to avoid overcrowding the tank:
First, always put your fish into a tank that will be large enough for their full grown size to avoid growth problems, or having to get more tanks as the fish grows.
For very small fish you can around two to three inches you can go by the one inch of fish per gallon rule. Do not use this rule for large fish, it doesn't work. For instance by the one inch of fish per gallon rule, you would be able to put a foot long fish in a less than a fifteen gallon tank. However you can't realistically do this, the fish wouldn't even be able to move. A fish that large needs a tank of about fifty gallons.
So, unfortunately there isn't really a rule to go buy (unless all of your fish are very small, three inches and under)
Just err on the side of caution, and if you notice ammonia spikes, abnormally dirty water, and fighting, you tank is probably overcrowded.
Basically just try to