The answer to this involves the arcane subject of primitive roots. However, without going into all the details about primitive roots, the simplest answer is this: If we find the smallest number for any prime denominator, p, such that 10^(p-1)=1 mod p, then that is the number of recurring decimal places in the fraction 1/p. The answer is never more than p-1 and often a sub-multiple of p-1.
Here are some examples: (Denominator > No. of recurring decimal digits);
3 > 1, because 10 = 1 mod 3.
7 > 6, because 10^6 = 1 mod 7.
11 > 2, because 10^2 = 1 mod 11 (2 is a sub-multiple of 10).
13 > 6, because 10^6 = 1 mod 13 (6 is a sub-multiple of 12).
17 >16, because 10^16 = 1 mod 17.
19 > 18, because 10^18 = 1 mod 19
23 > 22, because 10^22 = 1 mod 23
29 > 28, because 10^28 = 1 mod 29
31 > 15, because 10^15 = 1 mod 31 (15 is a sub-multiple of 30)
etc