Let $p \equiv 3 \pmod{4}$, with $p$ prime. You should know
$$\tag{noroot}
\text{there is no $w$ such that $w^{2} \equiv -1 \pmod{p}$.}
$$ This is simply because if $p = 3 + 4 a$, the group of invertible elements modulo $p$ has order $$p - 1 = 2 (1 + 2 a) = 2 \cdot \text{odd number},$$ for some $a$, so it cannot have an element of order $4$ as $w$ would be.
Suppose by way of contradiction $$p^{2 k+1} \mid x^{2} + y^{2}, \quad\text{but}\quad p^{2 k+2} \nmid x^{2} + y^{2}.$$ We argue by induction on $k \ge 0$.
If $p \nmid x$, then $x$ has an inverse $z$ modulo $p$. Multiply $0 \equiv x^{2} + y^{2} \pmod{p}$ by $z$ to get
$$
-1 \equiv (z y)^{2} \pmod{p},
$$
a contradiction to (noroot).
Thus $p \mid x$, so that $p \mid y$ as well. If $k = 0$, this is a contradiction, because then $p^{2} \mid x^{2}, y^{2}$, so that $p^{2} \mid n$.
If $k > 0$, you get that
$$p^{2 k-1} \mid \left(\frac{x}{p}\right)^{2} + \left(\frac{y}{p}\right)^{2},$$
but
$$p^{2 k} \nmid \left(\frac{x}{p}\right)^{2} + \left(\frac{y}{p}\right)^{2}.
$$
Induction now applies.
There is at least another proof, which involves Gaussian integers $G$. It is pretty easy to show that such a $p$ remains prime in $G$. Then if $p \mid x^{2} + y^{2} = (x + i y) (x - i y)$, it has to divide one of the factors, and thus both, as they are complex conjugates and $p$ is real. Now if $p^{e}$ is the largest power of $p$ dividing $x - i y$, then $p^{e}$ is also the largest power of $p$ dividing $x + i y$, so that $p^{2 e}$ is the largest power of $p$ dividing $x^{2} + y^{2}$.