The definition of basis of $\Bbb R^m$ is a set of vectors that are both linearly independent and spans $\Bbb R^m$. Assume that there are n vectors. Those n vectors in $\Bbb R^m$ form a matrix $[n_1 n_2 ...... n_n]$. If those vectors are linearly independent, that means that there must be n pivots in each column(because if there is a column without a pivot, there is a free variable, which leads to linear dependence).
That shows n <= m.(if n>m, there will be columns without pivots and again linear dependence) If you are not convinced, write a $3 \times 2$ or $4 \times 2$ matrix and see if they are linearly dependent.
Analyzing the second definition--those vectors span $\Bbb R^m$.
If that's the case, then the matrix will have a pivot in each row(if there is a row without a pivot, which has the form $[0,0,\cdots , 0]$, then the matrix can't span $\Bbb R^m$.) That gives us that $n \geq m$ .(again, try out some matrices that $n < $ m to see whether they span IR^m).
combine those two conclusions, we have $n\leq m $ and $n \geq m$. So n must equal to m.
Therefore a basis has to have the form of $n \times n$.