Spiral rifling grooves are cut into the bore of the barrel in order to impart a stabilizing spin to the bullet, as with a football when thrown.  A mathematician named George Greenhill derived the formula that is commonly used by gunsmiths to determine the twist required to stabilize a given bullet.  The formula is
Twist = 150 * D² / L where:
D = bullet diameter in inches
L = bullet length in inches
   
Bullet Diameter  in.
Bullet Length  in.
Minimum Twist Required: 1: in.
   
Then there are those times when you know what the twist rate for your barrel is, but you don't know the maximum bullet length that it can stabilize. Rearranging the Greenhill Formula, we see that:

Bullet Length = 150 * D² / T where:
D = bullet diameter in inches
T = # of inches required for one twist in your barrel
Bullet Diameter  in.
Twist - One turn in  in.
Maximum bullet length:  in.