Excellent question. I've provided some relevant literature (with a description of how to go about finding it) and a potential bound that seems to match yours numerically.
First, and for general advice, this is exactly the type of question that is well-suited to a literature search starting with the OEIS, as it. . .
. . . pertains to a sequence . . . that is in integers.
. . . is a question that is natural to ask and simple to communicate.
. . . has a rather pure, number theoretic flavor (i.e., focusing on numbers/objects/algorithms themselves and their properties, divorced from any specific contexts).
. . . admits a sufficiently unique sequence for the search to be direct.
After finding a relevant OEIS sequence, a literature search can become far easier, since the OEIS page itself can cross-reference literature but also since the OEIS index can grant a convenient term to refer to the problem when searching elsewhere (search engines, scholar, MSE, MO, approach0, etc.)
And indeed, after searching the first few terms, we are successful and find the sequence to be OEIS Sequence A002371. We can then cross-reference to earlier literature, which may have been cited by later work. We may find that George Salmon and William Shanks studied the sequence in the late 19th century. With this in mind, we may find a Scholar link to Shanks' paper with 5 citations, including Knudsen, The Discovery of a Periodic Table of the Prime Numbers, which explores the categorization of the primes by their period length (and which I regrettably lack access to read). Hopefully, you find this literature useful.
For a crude attempt to describe the asymptotic of your sequence, the length of the period for prime $p$ can be shown to be at most $p-1$ (or otherwise a divisor of that), as in MSE Q3545702. So then, the sum of period lengths for primes up to $n$ has, in the worst case, the following upper bound.*
$$
T(n)=\sum_{p\,\text{prime}\\p\le n} P(p) \le \sum_{p\,\text{prime}\\p\le n} (p-1)
\sim \frac{n^2}{2\log n}
$$
where the asymptotic to the sum is given by partial summation and the PNT, as in MO Q63412, and observing that the $-1$ term becomes $\pi(n)\sim \frac{n}{\log n}$ and vanishes.
* For convenience, I've recast your $S(x)$ (taken up to the index $x$ of the last included prime $p_x$) as $T(n)$ (taken up to an integer bound on the last included prime, $n\ge p_x$), so that we have $\displaystyle T(p_x)=\sum_{p\,\text{prime}\\p\le p_x} P(p)=S(x)$, and we should thus loosely expect $T(x\log x)\approx S(x)$ by the PNT. Then, the above worst case upper bound becomes $S(x)\le\ldots\sim \frac{\left(x\log x\right)^{2}}{2\log\left(x\log x\right)}$, which matches your $0.94782x^{2.11976}$ power approximation remarkably well (Desmos).