Squares of operators in QM Let $\vec{p} = p_x \hat{x} + p_y \hat{y} + p_z \hat{z}$, and also use the notation $|\vec{p}| = p$, where $p^2 = p_x^2 + p_y^2 + p_z^2$.
What is the difference between the operator $\hat{p}^2 = \hat{\vec{p}} \cdot \hat{\vec{p}}$, and the operator
$\widehat{p^2}$? And which one is the operator that correctly represents the magnitude of the momentum, squared?
 A: 
What is the difference between the operator $\hat{p}^2$, and the operator $\widehat{p^2}$?

For the sake of clarity let me call your operator $\widehat{P^2}$ as $\hat{M}$ (and let us first work with one dimension). Then by your definition (as stated in the comments), $$\hat{M}\vert\psi\rangle = p^2 \vert\psi\rangle,$$
where $\vert\psi\rangle$ is a momentum squared eigenstate. Now, $$p^2\vert\psi\rangle = p\cdot p \vert\psi\rangle = p\cdot \hat{P}\vert\psi\rangle = \hat{P}(p\vert\psi\rangle) = \hat{P}^2 \vert\psi\rangle.$$ Which means that $\hat{M} = \widehat{P^2} = \hat{P}^2$. Note that the operators $\widehat{P^2}$ and $\hat{P}^2$ share eigenstates (Why? It is because they commute. This can be arrived at by considering the Poisson bracket of classical $P^2$ and $P$).
But typically $P$ (from classical mechanics) is always quantized to give $\hat{P}$ (of quantum mechanics).

And which one is the operator that correctly represents the magnitude of the momentum, squared?

The above discussion should have made this clear. It really doesn't matter which one you use, as long as you define your $\widehat{P_i^2}$ to obey the eigenvalue equation that returns the ($i^{th}$ compononent of the) momentum squared value for any momentum eigenstate.
