Trying to use native habitat size is ridiculous. For example, many fish are migratory, and may cover thousands of miles. Or, live in a lake, and visit different parts of the lake during different seasons and life stages. That doesn't mean that their needs can not be met within a tank, just that this is how they live in the wild. The opposite is true as well--bettas CAN survive in little tiny depressions that have barely 1/2 gallon of swimming area, but that doesn't mean 1/2 gallon of water in a jar is at all comparable. Rice paddies filter that water regularly, the jar can't.
Length is a tricky one, since it has several implications. the most common, though faulty, is that length directly correlates to waste production. No way! Heavy bodied fish may produce much more waste than a single long skinny fish (compare a 5 inch clown loach to a 5 inch weather loach--totally different body mass, totally different waste production.) Larger mass fish will produce more waste, no matter the length. Second component has to do with living space. Ideally, the fish should be able to comfortable turn around without banging into the sides of the tank. However, this does not mean that super flexible fish can be crammed into tiny tanks, nor does it mean that rope fish and the like require a tank 36 inches in all directions. Common sense should tell you if the fish is cramped in it's quarters.
Of course, activity levels of the fish matters a great deal. Frantic danios are not suited for tanks with little swimming room--they tend to 'carpet-surf' if kept in small hex tanks, for example. An adult pleco tends to be sedentary, so swimming room isn't as big a deal, though the pleco won't like sharing his turf with conspecifics.
Numbers matter as well--as with clown loaches, where one fish is often hidden and sedate, but a group is a rough-housing pack.
There is no magic formula, and the technical literature won't often help. Searching for people who have kept the same fish for at least half of it's natural life span, with it displaying normal behavior and size, is the best advice, IMO.