There is no real corelation between the range animals are taken and the proper barrel length. Gunmakers have long ago figured out the best barrel lengths for typical guns. There is a reason almost all hunting guns have barrels between 20"-24". Between these lenghs it has more to do with personal preference, the rifles balance and how much muzzle blast you are willing to put up with. Between 20"-24" the velocity difference is insignificant, even with magnums.
Barrels longer or shorter are sometimes used, but only for special purposes. For shooting at extreme long range every tiny bit of velocity helps is one example. In these cases going up to 28-30" might make enough difference over a typical 22" barrel to matter.
Some like shorter 16"-18" barrels for quick handling in thick brush, shooting houses or tree stands. They do have a lot of muzzle blast, but even these short barrels still have enough velocity from modern chamberings to be effective out to 300-400 yards.