If $G$ is a connected compact Lie group and the base $M$ is homotopy equivalent to a finite cell complex, then a rough count of the set $[M, BG]$ is given by the rational homotopy theory. The point is that the classifying space $BG$ is rationally homotopy equivalent to the product of Eilenberg-MacLane spaces, e.g.

for $G=U(n)$ each Eilenberg-MacLane space corresponds to the Chern class.

for $G=SO(n)$ each Eilenberg-Maclane space corresponds to Pontryagin or Euler class.

For example, it follows that up to finite ambiguity a principal $U(n)$-bundles over $M$ is determined by its rational Chern classes, and conversely a multiple of any element in $\oplus_{i=1}^n H^{2i}(M;\mathbb Z)$ is realized as the collection of Chern classes of a principle $U(n)$-bundle over $M$.

One standard example (going back to Serre) is that there are only finitely many principal $G$-bundles over an odd-dimensional sphere (because it has no even-dimensional rational cohomology).

Another example is when $G=U(1)$. Then $[M, U(1)]$ is bijective to $H^2(M;\mathbb Z)$ via the Euler class (here $M$ is any paracompact space, see Husemoller's book "Fiber bundles", section on characteristic classes).

This is standard material but unfortunately not written in textbooks (except for the $U(1)$ case) so I refer to appendices in my papers here and here.

ADDED: regarding the difference between $SO(3)$ and $SU(2)$ bundles, a correct thing to say is that $SU(2)$ equals $Spin(3)$, so an $SO(3)$ bundle has a Spin structure which happens exactly when its second Stiefel-Whitney class vanishes. The class lives in $H^2(M;\mathbb Z_2)$. Thus the question is what "proportion" of $SO(3)$ bundles have a Spin structure. (I put proportion in quotation marks because
often both sets of bundles are countably infinite.) The answer of course depends on $M$. If $H^2(M;\mathbb Z_2)=0$, every $SO(3)$ bundle over $M$ is spin. In general, the universal coefficients theorem tells us which classes in $H^2(M;\mathbb Z_2)$ come from $H^2(M;\mathbb Z)$, and any class in the latter group can be realized as the Euler class of an $SO(2)$ bundle, and its mod 2 reduction is the Stiefel-Whitney class. Since any $SO(2)$ bundle is gives rise to an $SO(3)$ bundle we can realize many nonzero classes in $H^2(M;\mathbb Z_2)$ as Stiefel-Whitney classes of some $SO(3)$ bundles; these bundles are not spin.

classifying space$B G$ for G-principal bundles. See ncatlab.org/nlab/show/classifying+space – Urs Schreiber Jul 19 '13 at 12:04issimilar to the case of finite gauge groups: if G is discrete then maps $X \to BG$ are the same as maps $\pi_1(X) \to G$ and the notion of homotopy translates. One thing to realize is that also $Hom(\pi(X),G)/G$ is less trivial than it may seem. It's a moduli space of flat connections, which harbours some non-trivial theory, see ncatlab.org/nlab/show/moduli+space+of+connections – Urs Schreiber Jul 19 '13 at 13:15