How is that $A^n A\neq A A^n$? How is that $A^n A\neq A A^n$? Where $A$ is a $n\times n$ matrix whose elements belong to a set with ring structure(it may not be commutative).
$A^nA$ can be expressed as $(AA\cdots AA)A$, which, by associativity of matrix multiplication it means that it is the same as $A(AA\cdots AA)$
Suppose the $2\times 2$ matrix 
$
\begin{pmatrix}a & b \\ c & d \end{pmatrix}
$. Then $A^2=
\begin{pmatrix}
 a^2+b c & a b+bd \\
 ca+d c & cb+d^2 \\
\end{pmatrix}$
But
\begin{align}
A^3=AA^2&=
\begin{pmatrix}a & b \\ c & d \end{pmatrix}\begin{pmatrix}
 a^2+b c & a b+bd \\
 ca+d c & cb+d^2 \\
\end{pmatrix} \\
&= \begin{pmatrix}
 a(a^2+b c)+b(ca+d c) & a(a b+bd)+b(cb+d^2) \\
 c(a^2+b c)+d(ca+d c) & c(a b+bd)+d(cb+d^2) \\
\end{pmatrix}
\end{align}
and
\begin{align}
A^3=A^2A&=
\begin{pmatrix}
 a^2+b c & a b+bd \\
 ca+d c & cb+d^2 \\
\end{pmatrix}\begin{pmatrix}a & b \\ c & d \end{pmatrix} \\
&= \begin{pmatrix}
 (a^2+b c)a+(a b+bd)c & (a^2+b c)b+(a b+bd)d \\
 (ca+d c)a+(cb+d^2)c & (ca+d c)b+(cb+d^2)d \\
\end{pmatrix} \\
A^3=A^2A&\neq AA^2=A^3
\end{align}
knowing the fact that commutativity of its elements is not a given. This means that matrix multiplication over a matrix with elements of rings as its elements is not associative, which means it is not a matrix, right? How is this explained?

Do a little more algebra and expand out the terms.  For example,
$$ (AA^2)_{1,1} = a(a^2+bc) + b(ca + dc) = a^3 + abc + bca + bdc $$
and
$$ (A^2A)_{1,1} = (a^2+bc)a + (ab + bd)c = a^3 + bca + abc + bdc. $$
Since addition is commutative, these two terms are equal.  The remaining entries are similar.
