An easy case is the geometric one.
Suppose you have an algebraic variety $V$ over a field $k$ defined by the polynomials $F_1,F_2,...,F_r\in k[X_1,...,X_n]$, that is $V=V(F_1,F_2,...,F_r)\subset \mathbb A^n_k$ and the local ring you are interested in is $A=\mathcal O_{V,P}$ for some rational point $P\in V$ with coordinates $(a_1,a_2,...,a_n)\in k^n$.
You can consider the jacobian matrix $Jac(P)=(\frac {\partial F_i}{\partial X_j}(P))_{i,j} \in k^{r\times n}$
The number you are interested in is then characterized by the rank over $k$ of this matrix and given by the formula
$ dim_k (m_{V,P} / m^2_{V,P})=n-rank(Jac(P)) $
An unintuitive example If $V\subset \mathbb A^n_k$ is the curve parametrically given by $x_1=t^n,x_2=t^{n+1},...,x_n=t^{2n}$, all polynomials vanishing on the curve will have their partial derivatives zero at at the origin $O=(0,...,0)$ and so $Jac(O)$ is the zero matrix. Hence $ dim_k (m_{V,O} / m^2_{V,O})=n-rank(Jac(O)) =n $.
This reflects that the curve is very singular at the origin, which is what the invariant you are interested in is meant to detect (it would be $1$ instead of $n$ for a smooth curve).
A nice application You can prove with the above formula that in $\mathbb A^3_k$ the union of three coplanar lines through the origin is not isomorphic to the union of the three coordinate axes, not even locally at the origin: the singularities are different (which is not so easy to see with the naked eye...)