The topic is too general, and your question is too vague.
At any rate, for a large $x$, the average value of $r(n)$ for $1\leq n\leq x$ is about $\pi$, while the standard deviation is about $2\sqrt{\log x}$. There are many ways to prove this, perhaps the most instructive is to look at the Dirichlet series $\sum r(n)n^{-s}$ and $\sum r(n)^2n^{-s}$ which have poles of order $1$ and $2$, respectively (as follows from their Euler product decomposition). The following recent paper discusses the analogous problem in short intervals: Garaev-Kühleitner-Luca-Nowak, Asymptotic formulas for certain arithmetic functions, Math. Slovaca 58 (2008), 301–308.