Number of height-limited rational points on a circle

I'll content myself with counting the number of points on $C(1)$ (which should surely be close to the maximum) -- the answer is quite nice, it is about $ \frac{4}{\pi } h$.

To see this, note that we are counting essentially Pythagorean triples $u^2-v^2, 2uv, u^2+v^2$, with $u^2+v^2\le h$ and we may suppose that $u$ and $v$ are non-negative, that $u$ and $v$ are coprime, and that $u^2+v^2$ is odd. The lattice point count we need is four times this number, since we must also count the lattice point $(2uv/(u^2+v^2),(u^2-v^2)/(u^2+v^2))$ (in addition to $((u^2-v^2)/(u^2+v^2),2uv/(u^2+v^2))$, and we must also allow the $2uv/(u^2+v^2)$ coordinate to be negative).

Thus to summarize we want $$ 4 \sum_{n\le h, n \text{ odd }} R(n), $$ where $R(n)$ is the number of ways of writing $n$ as $u^2+v^2$ with both $u$ and $v$ non-negative and coprime (taking care to set $R(1)$ to be $1$). A little number theory, going back to Fermat, gives that $R(n)$ is a multiplicative function with $R(2^k)=0$ (so we don't have to worry about $n$ odd anymore), $R(p^k)=2$ for $p\equiv 1\pmod 4$ and $k\ge 1$, and $R(p^k)=0$ if $p\equiv 3\pmod 4$. For example if $h=20$, then $R(1)=1$, $R(5)=2$, $R(13)=2$, and $R(17)=2$ and the rest are zero, and the number here is $28$ as in the numerics.

From here a standard argument (or one can do this via counting lattice points in a circle) leads to the asymptotic $$ 4 \sum_{n\le h} R(n) \sim 4 \frac{1}{2} \prod_{p\equiv 1 \pmod 4} \Big(1+\frac{2}{p}+\frac{2}{p^2}+\ldots \Big) \Big(1-\frac 1p\Big) \prod_{p\equiv 3\pmod 4} \Big(1-\frac 1p\Big) h, $$ and the above simplifies (using $1-1/3+1/5-1/7+\ldots =\pi/4$ and $1/1^2+1/3^2+1/5^2+\ldots = \pi^2/8$) to give $$ \sim 2 \frac{\pi/4}{\pi^2/8} h = \frac{4}{\pi} h. $$

One should be able to refine this to count lattice points on other circles as well, and thus show that radius $1$ does achieve the maximum.