In addition to the very good suggestions by Fraccalo, the issue here is that Mathematica refuses to overwrite arguments of functions (in general). So you have to introduce a local variable like this:
f[n0_] := Module[{n = n0},
While[n < 10, n = n + 1];
n
]
There is a way to emulate so-called call-by-reference that you might know from C-like programming languages. This can be done as follows; however, I would strongly recommend to ignore this feature until you are more proficient with the language, because this is not the way one should program in Mathematica:
SetAttributes[g,HoldAll];
g[n_]:= While[n < 10, n = n + 1];
Then you can do
n=3;
g[n];
n
10
but g[3] won't work any more (because 3 is not a variable and thus does not have an "adress" to write to).