By rank $rk\ G$ of a group I mean the minimum set of its generators (even if the group is abelian, I consider it as if it were just a general group $-$ I do not mean here torsion-free rank!).
For a finite abelian group $A=Z_{p_1}^{m_1}\times\cdots\times Z_{p_n}^{m_n}$, where $Z_p=Z/pZ$ are cyclic groups and $p_i$ are prime numbers, is it true that $rk\ A=\sum m_i$? (Not torsion-free rank!)
In particular, is it true that for $A=Z_2^n=(Z/2Z)\times\cdots\times(Z/2Z)$ ($n$ copies), $rk\ A=n$?
If yes, could you please provide (or point to) a proof?
Your particular question is just "Does the vector space $\mathbf{F}_2^n$ over the field $\mathbf{F}_2$ have dimension $n$?"
For the question above that, it is not true! To get a flavor of the problem, observe that $\mathbf{Z}_2 \times \mathbf{Z}_3 \cong \mathbf{Z}_6$.
See the structure theorem for finitely generated modules over a principal ideal domain. Your question is the special case where the principal ideal domain is just the integers, so that "module" means "abelian group". "Invariant factors" and "Smith normal form" are probably things to pay close attention to.