(Too long for a comment) A finitely generated subgroup of a direct limit of groups is isomorphic to a quotient of a subgroup of one of the constituent groups.

Indeed, suppose that $\{G_i, f_{ij}\}_{i\in I}$ is a directed family, $G$ a subgroup of $\lim\limits_{\rightarrow} G_i$, and that $G=\langle g_1,\ldots,g_n\rangle$. The elements of $G$ are equivalence classes of pairs $(x,i)$, with $i\in I$ and $x\in G_i$, where $(x,i)\sim (y,j)$ if and only if there exists $k\geq i,j$ such that $f_{ik}(x)=f_{jk}(y)$. For each $i=1,\ldots,n$, there exists $j_i\in I$ such that $g_i=[x_i,j_i]$. Let $k\geq j_1,\ldots,j_n$. Then $g_i = [f_{j_ik}(x_i),k]$, so that $g_1,\ldots,g_n$ can be identified with elements of $G_k$; hence, $G$ is isomorphic to the image of this subgroup inside $G$ (via the canonical map from $G_k$ into $G$).

So if all the $G_k$ are finite, then so is $G$. If all the $G_k$ are finite $p$-groups, then so is $G$. The class of groups that are finite rank and direct limits of finite $p$-groups are exactly the finite $p$-groups.