There is a short exact sequence of coefficients $\mathbb{Z}\rightarrow \mathbb{R}\rightarrow \mathbb{R}/\mathbb{Z}=S^1$. This gives you a long exact sequence of cohomology groups. For a finite group $Q$, $H^i(Q:\mathbb{R})=0$ for $i>0$, so the long exact sequence collapses to an isomorphism $H^2(Q;S^1)\cong H^3(Q;\mathbb{Z})$.
You can use this to classify the isomorphism types of 1-dimensional compact non-connected Lie groups as in your question. For $p$ odd, there is only the direct product for $S^1\rightarrow G\rightarrow C_p$. For $p$ odd, there are two isomorphism types of group $S^1\rightarrow G \rightarrow (C_p)^2$, and there are two isomorphism types of group $S^1\rightarrow G\rightarrow (C_p)^3$. Of course it gets more complicated as $k$ increases, and $p=2$ is more complicated than odd $p$.
For $p=2$ there are already three groups $S^1\rightarrow G\rightarrow C_2$: the direct product, the orthogonal group $O(2)$, and the subgroup of the unit quaternions generated by the circle $\cos(\theta)+i\sin(\theta)$ and $j$.
In the first chapter of my PhD thesis (available on ArXiv in an extended version as https://arxiv.org/abs/0711.5020) I classified 1-dimensional compact Lie groups with $p^k$ components for each prime $p$ and each $k\leq 3$. The numbers that I got were 1, 3, 8 for $p$ odd and 3, 8, 29 for $p=2$. I presume that this was already known and I did not try to publish it. Comparing it to the classification of $p$-groups, classifying these groups for $p^k$ components is harder than classifying $p$-groups of order $p^{k+1}$ but it is easier than classifying the $p$-groups of order $p^{k+2}$.