The number of fish you can have in a tank at any one time will depend on both the size of your fish tank and also the type of fish you have. Some fish, such as betta, can be aggressive with others so need to be kept alone. But for multi-fish tanks, the general guidance is one inch of fish per gallon of water.
However, this doesn’t consider the type of fish you want to keep, the filtration system you have and the accessories and plants you intend to place in your aquarium. And it doesn’t take into account juvenile fish and their growth to adult. So, the best way to work out how many fish you can have in a fish tank is to know the type of fish you want and work from the largest, then base your total fish number on two gallons of water per one inch of fish, to reduce any margin for error.