As you note (Wikipedia)
The formula was first discovered by Abraham de Moivre in the form
$$n!\sim \text{constant}\cdot n^{n+1/2} e^{-n}.$$
De Moivre gave an expression for the constant in terms of its natural
logarithm. Stirling's contribution consisted of showing that the
constant is $\sqrt{2\pi}$. The more precise versions are due to
Jacques Binet.
When it comes to getting credit, you should check that lemma that says that when a finding is attributted to someone, it isn't usually the real discoverer (ironically enough this finding was proved to be discovered by yet anoher person before, so the finding itself is an example of this controversy).
I guess the credit is given to him for his asymptotic expansion in series, which gives the "little" approximation:
$$n! \sim {n^n}{e^{ - n}}\sqrt {2\pi n} $$
As to how the approximation is found, I answered some days ago the following:
If you're familiar with [Wallis infinite product]
$$\mathop {\lim }\limits_{n \to \infty } \frac{{\left( {2n} \right)!!}}{{\left( {2n - 1} \right)!!}}\frac{1}{{\sqrt n }} = \sqrt \pi $$
Then you can use
$$\eqalign{
& \mathop {\lim }\limits_{n \to \infty } \frac{{\left( {2n} \right)!{!^2}}}{{\left( {2n} \right)!}}\frac{1}{{\sqrt n }} = \sqrt \pi \cr
& \mathop {\lim }\limits_{n \to \infty } \frac{{{2^{2n}}{{\left( {n!} \right)}^2}}}{{\left( {2n} \right)!}}\frac{1}{{\sqrt n }} = \sqrt \pi \cr} $$
Now you can check that
$$\alpha = \mathop {\lim }\limits_{n \to \infty } \frac{{n!{e^n}}}{{{n^n}\sqrt n }} = \mathop {\lim }\limits_{n \to \infty } \frac{{\left( {2n} \right)!{e^{2n}}}}{{{{\left( {2n} \right)}^{2n}}\sqrt {2n} }}$$
exists. Then square the first expression and divide by the latter to get
$$\alpha = \mathop {\lim }\limits_{n \to \infty } \frac{{{{\left( {n!} \right)}^2}{e^{2n}}}}{{{n^{2n}}n}}\frac{{{{\left( {2n} \right)}^{2n}}\sqrt {2n} }}{{\left( {2n} \right)!{e^{2n}}}} = \mathop {\lim }\limits_{n \to \infty } \frac{{{{\left( {n!} \right)}^2}{2^{2n}}\sqrt 2 }}{{\left( {2n} \right)!\sqrt n }} = \sqrt {2\pi } $$
Thus you have that
$$\mathop {\lim }\limits_{n \to \infty } \frac{{n!{e^n}}}{{{n^n}\sqrt {2n} }} = \sqrt \pi $$
or
$$n! \sim {n^n}{e^{ - n}}\sqrt {2\pi n} $$