Finding the order of an element in $GL(2,\mathbb{R})$
Matrix multiplication is not commutative, but it is associative, so taking powers make sense: $A^3 = A \cdot (A \cdot A) = (A \cdot A) \cdot A$, and so forth. More generally, $A^n$ is well-defined.
A square matrix commutes with itself, with respect to both matrix addition and multiplication, and we have associativity to justify this:
By associativity, we have, e.g. $$A^4 = A\cdot A^3 = A\cdot (A \cdot A^2) = A\cdot(A\cdot(A\cdot A)) = A\cdot ((A\cdot A)\cdot A) $$ $$= (A \cdot (A \cdot A))\cdot A = ((A\cdot A)\cdot A)\cdot A = (A^2\cdot A) \cdot A = A^3\cdot A = A^4$$
In general: $A^n = A\cdot A^{n-1} = A^2 \cdot A^{n-2} = \cdots = A^{n-2}\cdot A^2 = A^{n-1} \cdot A$...
Indeed, note that in your present exercise, after having computed $A^2 = -I$, we have that $$A^4 = A^2\cdot A^2 = -I \cdot -I = (-1)^2 I^2 = I$$ which could have saved you a lot of work!