I am new at calculus and so I am studying derivatives now. We know that, $$\frac {d}{dx} (x^2) = 2x$$
I know the proof of it by the first rule derivatives. But still, my question is why. It is simply calculating the slope when $y = x^2$ with respect to $x$. Here is the graph of $y = x^2$
In this graph it is really clear that when $x = 3$, $y = 9$
If a slope is defined as $\tan \theta$ which is equal to $y\over x$ in a graph.
Then, why $\frac {d}{dx} (x^2) ≠ x$ when $y = x^2$ as the slope $\frac {x^2}{x} = x$?

Your $\frac{x^2}{x}$ is not the slope of the graph at $x$. It is the slope of the line from the origin to the point $(x,x^2)$ on the graph.
Interactive plot.