To further complicate the matter: (Like it isn't mysterious enough!) Most of the above is correct.
Twist is measured by one complete rotation of the bullet while traveling so many inches forward. This is determined by the 'twist rate' built into the barrel. It is usually shown as one (1) full revolution in (xx) inches, eg. 1:7 means 1 revolution (turn) in 7 inches of travel. Like gauge, the larger the second or travel number, the slower the twist rate. In 'metric' terminology one revolution is still identified as "1". But the distance is given as (usually) millimeters. So in Europe one finds the notation "1:118" meaning "one revolution for one hundred seventeen millimeters" (which is the same as 1:7 in Imperial notation).
A longer bullet requires MORE spin or twist than a shorter bullet. In the old days when the initial work was done, all bullets were made from lead (with a thin brass jacket) so the only way to make a bullet heavier was to use more lead; so the bullets were heavier. However, one finds the LENGTH of the bullet means much more than the WEIGHT of the bullet. With new technology making bullets of copper or depleted uranium, 'weight' is no longer the determining factor. "Length" is still the measure.
The twist rate can only be changed by changing the barrel. If one decides the twist rate is not 'right', one cannot take a rifle or handgun to the gunsmith and have the barrel adjusted. Consequently, an improper twist rate can only be 'fixed' by a new barrel. Or by the understanding that one's barrel will simply not be accurate with bullets that are 'too heavy' (too long) or 'too light' (too short).
Couple of other considerations:
Twist rate is not 'point specific', it is more a 'range'. Usually the twist rate given by the many different applications available on line or by calculation gives the slowest spin needed for a given bullet. Not the only spin rate.
A larger amount of 'over spin' is safer for accuracy than a small amount of 'under spin'. Yes, spinning a bullet too fast can cause stability problems, but usually one has to work hard to get overspin. The late Parker O. Ackley once built a rifle (.219 Donaldson Wasp as I recall) with a 1 in 5 twist. It spun bullets fast enough that some of the lighter constructed bullets would tear apart in flight due to the spin. But he makes no note of 'inaccuracy'.
Rifles built in the early part of the 20th Century (the 1894 and 1896 Swedish Mausers and other 6.5mm calibers of that same period) used 160 grain or 10.1 gram bullets as standard. Twist rates were usually 1:7. Lighter (shorter) bullets in 120 and even 87 grain are not over spun.
The .30-40 Krag-Jorgensen fired a 220 grain bullet with a 1:10 twist for comparison. Subsequent work shows the early Swedes handle 120 grain bullets quite well. U. S. rifles in 30 caliber all use 1:10 twist (except the .30 Carbine, which seems to shoot just as well with the faster twist). Those rifles being in .30 Government (.30-40 Krag), .30-03 Springfield, .30-06 Springfield and 7.62x51mm NATO (.308 Winchester) and handle lighter - shorter bullets just as well.
Usually, the choice is already made by the manufacturer. Not something to keep one up at night.