Just for the sake of completeness, here I am posting the answer of Pete Clark which was posted in the math.SE question. I am making this post CW so as not to create the unseemly impression that I am gaining any undeserved reputation from this. Here it is:
Virtually nothing is known about the question of which abelian groups can be the ideal class group of (the full ring of integers of) some number field. So far as I know, it is a plausible conjecture that all finite abelian groups (up to isomorphism, of course) occur in this way. Conjectures and heuristics in this vein have been made, but unfortunately for me I'm not so familiar with them.
The situation for imaginary quadratic fields is different. Here there is an absolute bound on the size of an integer $k$ such that the class group of an imaginary quadratic field can be isomorphic to $(\mathbb{Z}/2\mathbb{Z})^k$. Conditionally on the Generalized Riemann Hypothesis, the largest such $k$ is $4$. This has do to with idoneal numbers, of which the following paper provides a very fine survey:
http://www.mast.queensu.ca/~kani/papers/idoneal-f.pdf
Actually the truth is slightly stronger: let $H_D$ be the class group of the imaginary quadratic field $\mathbb{Q}(\sqrt{-D})$. Then, as $D$ tends to negative infinity through squarefree numbers, the size of $2H_D$ (the image of multiplication by $2$) tends to infinity. See for instance
http://arxiv.org/PS_cache/arxiv/pdf/0811/0811.0358v2.pdf
for some recent explicit bounds on this.