Let $x=n+e.$ Then $y=n+n^2/e.$ So $e=\pm d$ where $d$ is a positive divisor of $n.$ So it is $necessary$ that $(x,y)$ is
Type 1: $(x,y)=(n+d,n+n^2/d)$ with $0<d|n$
OR Type 2: $(x,y)=(n-d,n-n^2/d)$ with $0<d|n^2.$
It is easily seen that either Type is also $sufficient.$
A Type 1 pair $(x,y)$ cannot be a Type 2 pair $(x',y'),$ as $x>n>x'.$
If $0<d|n$ and $0<d'|n$ we cannot have $(n+d, n+n^2/d)=(n+d', n+n^2/d')$ nor $(n-d,n-n^2/d)=(n-d', n-n^2/d')$ unless $d=d'.$
So for each positive divisor $d$ of $n^2$ we have $2$ solutions, adding up to $2\delta (n^2)$ solutions, where $\delta (n^2)$ is the number of positive divisors of $n^2.$
If $|n|=1$ then $\delta (n^2) =1.$
If $|n|>1$ and if $\prod_{i=1}^kp_i^{\alpha_i}$ is the prime decomposition of $|n|$ then $n^2=\prod_{i=1}^kp_i^{2\alpha_i},$ so $$\delta(n^2)=\prod_{i=1}^k(1+2\alpha_i).$$