Step 1: Find which numbers have exactly 2 factors:
Only prime numbers have exactly two factors. So the number is a prime, say 2, 3, 5, 7, and so on.
Step 2: Test small primes:
For a prime $p$, the factors of $p^{2}$ are $1, p, p^{2}$.
$p=2$: $1+2+4 = 7$.
$p=3$: $1+3+9 = 13$.
$p=5$: $1+5+25 = 31$, which is the given sum.
Step 3: Check that no larger prime works:
The sum $1+p+p^{2}$ keeps growing with $p$. For $p=7$ it is 57, already above 31. So $p=5$ is the only choice.
Final Answer:
The cube of the number is
\[ \boxed{5^{3} = 125} \]