The dimension of a finite-dimensional vector space is the number of vectors in any basis. All bases have the same size. The zero space has dimension zero; $P_n$ has dimension $n+1$; $m\times n$ matrices form a space of dimension $mn$. Dimension counts independent directions, not the number of elements.