It's true for all finite groups that every subgroup has order dividing that of the main group. This is called Lagrange's theorem. The converse is not true of all finite groups.
A finite group of size $n$ which has subgroups of size $d$ for all $d \mid n$ is called a Lagrangian group or a CLT group ("Converse to Lagrange's Theorem"). They're still not completely characterised, but it's known that they're all solvable.
However, two general results tell us some things about subgroups which have certain sizes:
- Cauchy's theorem tells us that whenever $p \mid n$, there is a subgroup of size $p$;
- Sylow's theorems tell us that whenever $p^i \mid n$ is the highest power of $p$ dividing $n$, then there is a subgroup of size $p^i$.
All finite abelian groups are Lagrangian (including $\mathbb{Z}_n$ for all $n$, where the proof is simple: just take the subgroup generated by $\frac{n}{d}$, which has order $d$).
Related SE question which contains much more detail: Complete classification of the groups for which converse of Lagrange's Theorem holds.
I'd like to call attention to Ethan Bolker's comment on your question, which I wholeheartedly endorse:
+1 for the observation. If you continue to pay this kind of attention to the theorems (and, particularly, the examples) in your abstract algebra course you may well find yourself guessing/anticipating theorems you will see in the weeks to come. In particular, you'll soon get to Lagrange's theorem. as some of the answers point out. You should be pleased, not discouraged, when answers like that refer to stuff you haven't yet studied.