Example 1 Let $p$ be a prime number, and the number of distinct positive divisors of $p^{2}+71$ does not exceed 10. Find the value of $p$.
(2006, National High School Mathematics League, Jiangsu Province Preliminary Contest)
When $p=2,3$, it is verified that they satisfy the problem statement.
When $p>3$,
$$
p^{2}+71=(p+1)(p-1)+72 \text { . }
$$

If $p=3 k+1$ (where $k$ is even), then
$$
p^{2}+71=3 k(3 k+2)+72 \Rightarrow 24!\left(p^{2}+71\right) \text { . }
$$

Let $p^{2}+71=24 m=2^{3} \times 3 m(m \geqslant 4)$.
When $m$ contains a prime factor other than $2$ and $3$, the number of distinct positive divisors of $p^{2}+71$ is no less than
$$
(1+3)(1+1)(1+1)>10 \text {; }
$$

When $m=2^{r}(r \geqslant 2)$, the number of distinct positive divisors of $p^{2}+71$ is no less than
$$
(1+5)(1+1)>10 \text {; }
$$

When $m=3^{r}(r \geqslant 2)$, the number of distinct positive divisors of $p^{2}+71$ is no less than
$$
(1+3)(1+3)>10 \text {. }
$$

Similarly, if $p=3 k-1$, it also does not hold.
In conclusion, $p=2$ or 3.