I'll add pages later to explain this rudimentary part of IP Addressing. Remember that Subnet masking is exactly that. You are masking a portion of the IP address to be used for Network ID's and the remainder for hosts. For the purpose of this discussion we will assume it is a class B address. Now lets say you need 25 subnets with 500 hosts on each one.
OK lets see if that is possible.
Look at the Subnets Available row in the table above. This is not too hard as well. Here is a well known tutorial that I did not write but has helped many.