It depends upon the function of the rifle and what you want its effective range to be. If the rifle is to be used against moderately large targets (such as man), then you want the bullet to impact (ideally) with a velocity of at least 2700 fps to achieve maximum wounding potential. Then, use that range to determine the barrel length required to achieve 2700 fps at the required distance. For example, if you want an optimal effective range of about 100 yards using M 193, a barrel length of at least 16 inches is needed to retain 2700 fps at bullet impact.
Several notes regarding the above statements. 1. There may be other factors to consider, such as if iron sights are to be used and a longer sight radius is needed to increase accuracy of aim. 2. M 193 certainly may be lethal at velocities below 2700 fps, but the wounding potential is potentially reduced. 3. I currently have no velocity charts available, so my example is an approximation. 4. The initial velocity and composition of the bullet will affect the above calculation.