If I have an abelian group $G$ of order $p^n$, how can I decide if it's isomorphic to $\Bbb{Z}_p \times \Bbb{Z}_p \times\ldots \times \Bbb{Z}_p$ ($n$ times) or to $\Bbb{Z}_{p^2} \times \Bbb{Z}_p \times\ldots \times \Bbb{Z}_p$ ($n-1 $times), etc.
For example, mean if my group is order 8, how can i decide if it's isomorphic to $\Bbb{Z}_8$ or to $\Bbb{Z}_2\times \Bbb{Z}_4$ or to $\Bbb{Z}_2\times \Bbb{Z}_2\times \Bbb{Z}_2$?
Do i have to analyze the group, order of its elements and then decide or does there exist a theorem or criterion to decide it instantly?
The most usual way would be to look at the order of the elements in your given group. Using your example where $|G| = 8$, suppose you find that $G$ contains an element of order $8$. Then $G$ must be $\newcommand{\Ints}{\mathbb{Z}} \Ints_8$ because neither $\Ints_4 \times \Ints_2$ and $\Ints_2 \times \Ints_2 \times \Ints_2$ have an element of order $8$.
Otherwise if there is no element of order $8$, but you do find an element of order $4$, then $G$ is $\Ints_4 \times \Ints_2$ because $\Ints_2 \times \Ints_2 \times \Ints_2$ has no element of order $4$.