MathOverflow will be down for maintenance for approximately 3 hours, starting Monday evening (06/24/2013) at approximately 9:00 PM Eastern time (UTC-4).

1 [made Community Wiki]

Compact Lie groups may not be connected, and the question did not assume connectedness whereas all of the other answers did. If $G$ is a linear algebraic group over $\mathbf{R}$ then $G(\mathbf{R})$ has finite component group which may be non-trivial even when $G$ is connected in the sense of the Zariski topology, such as $G = {\rm{GL}} _n$; see end of Borel's book on linear algebraic groups for a proof. And orthogonal groups for non-degenerate real quadratic forms of various signatures are very useful, but (in their incarnation as linear algebraic groups over $\mathbf{R}$) are even disconnected for the Zariski topology. So there is good reason to be interested in real Lie groups with nontrivial but finite component group (e.g., finite groups!) And in Hochschild's book "Structure of Lie Groups" he proves that the theory of maximal compact subgroups "works" in the case of finite component groups too: they're all conjugate and meet every component.

This is all setup for what I really wanted to say, which is that there is an awesome result, largely due to Chevalley, which beautifully "explains" the essentially algebraic nature of the category of compact Lie groups (without connectedness hypotheses). This concerns the functor $G \rightsquigarrow G(\mathbf{R})$ from linear algebraic groups over $\mathbf{R}$ to real Lie groups with finite component group. To appreciate the result, we need some preliminary observations, as follows. If $G(\mathbf{R})$ is to be compact then of course $G$ cannot contain as an $\mathbf{R}$-subgroup either $\mathbf{G}_a$ or $\mathbf{G}_m$. In particular, $G$ has to be reductive (maybe disconnected) since $\mathbf{R}$ has characteristic 0. [Side remark: for reductive groups over any field $k$ whatsoever, if there is a $\mathbf{G}_a$ as a $k$-subgroup then there must be a $\mathbf{G}_m$ as a $k$-subgroup; i.e., it is $k$-isotropic. See Corollary C.2.9 in "Pseudo-reductive groups" for a generalization.] It is a general fact (over any local field $k$ at all, whether archimedean or not) that a reductive $k$-group has compact group of $k$-points if and only if it contains no $\mathbf{G}_m$ as a $k$-subgroup (i.e., is $k$-anisotropic). Also, if $G$ is disconnected then it can happen that some connected components of $G$ have no $\mathbf{R}$-point (e.g., kernel of ${\rm{det}}^3$ on ${\rm{GL}} _n$ for any $n$), but the union of those components which do contain an $\mathbf{R}$-point is an open $\mathbf{R}$-subgroup which is "all" one could hope to ever recover from $G(\mathbf{R})$. So we may as well focus attention on those $G$ for which each connected component of $G$ does have an $\mathbf{R}$-point.

OK, so now we can state Chevalley's result. The preceding remarks show that formation of real points (as a Lie group) is a functor from the category of $\mathbf{R}$-anisotropic reductive $\mathbf{R}$-groups to the category of compact real Lie groups. (Beware it is not obvious if $G(\mathbf{R})$ is also connected for such a $G$ that is connected.) Chevalley proved that this is an equivalence of categories. More specifically, given a compact real Lie group $K$, he showed how to use the representation theory of $K$ to functorially construct a linear algebraic $\mathbf{R}$-group $K^{\rm{alg}}$ whose Lie group of $\mathbf{R}$-points is naturally isomorphic to $K$ (so $K^{\rm{alg}}$ must be reductive and $\mathbf{R}$-anisotropic, for reasons noted above). The construction shows also that every connected component of $K^{\rm{alg}}$ has an $\mathbf{R}$-point, and clearly $K^{\rm{alg}}$ is connected if $K$ is connected. That much is proved in the book by Brocker and tom Dieck. Using some input from the algebraic side (especially the fact that a semisimple Lie subalgebra of the Lie algebra of a linear algebraic group over a field $k$ of characteristic 0 is the Lie algebra of a unique connected closed $k$-subgroup which moreover is semisimple, so over $\mathbf{R}$ these "exponentiate" to closed $\mathbf{R}$-subgroups), one can show that it really inverts the functor of $\mathbf{R}$-points on the full subcategory of $\mathbf{R}$-anisotropic reductive $\mathbf{R}$-groups whose connected components all have $\mathbf{R}$-points.

To summarize, incorporating topological aspects:

Theorem (Chevalley) The category of compact Lie groups is equivalent to the category of $\mathbf{R}$-anisotropic reductive $\mathbf{R}$-groups whose connected components have $\mathbf{R}$-points, and if $G$ is such an $\mathbf{R}$-group then $G^0(\mathbf{R}) = G(\mathbf{R})^0$. The $\mathbf{R}$-group $G$ is semisimple if and only if $G(\mathbf{R})$ has finite center, and in such cases $G^0$ is simply connected in the sense of algebraic groups if and only if $G(\mathbf{R})^0$ is simply connected in the sense of topology.

Remark: The anisotropicity hypothesis is crucial. For example, if $n > 1$ is odd then ${\rm{SL}} _n \rightarrow {\rm{PGL}} _n$ is a degree-$n$ isogeny of $\mathbf{R}$-groups (so not an isomorphism) which induces an isomorphism on $\mathbf{R}$-points.

For any $G$ as in the Theorem, one can show that $G(\mathbf{C})$ contains $G(\mathbf{R})$ as a maximal compact subgroup, and that this is a "complexification" of $G(\mathbf{R})$ in the sense of being initial among complex Lie groups equipped with a homomorphism from $G(\mathbf{R})$. Using this and passing to the connected case, one shows that every $\mathbf{R}$-split connected reductive $\mathbf{R}$-group admits a unique "$\mathbf{R}$-anisotropic form" (usually called "compact form"), and this correspondence is also functorial if we keep track of a choice of suitable maximal torus. But the algebraic theory provides an equivalence between the category of pairs $(G,T)$ consistng of split connected reductive groups $G$ equipped with a choice of split maximal torus $T$ over any field, with isogenies as morphisms, and the category of root data with (a suitable notion of) "isogenies" as morphisms. This recovers exactly the classification of compact connected Lie groups (equipped with a maximal torus) in terms of root data as was mentioned in the other answers.

Of course, this is a much longer route to the punchline, and I am not recommending it as a good way to learn the classification of compact Lie groups in terms of root data (though it would not be circular to do so). But there is something remarkable about the direct link between compact Lie groups and algebraic groups (allowing disconnectedness as well, and no specified maximal torus), not defined by going through the crutch of root data and Lie algebras. Historically the case of compact groups was a very important guide for Borel and Tits and others when developing the structure theory for connected reductive groups, and the above result "explains" a posteriori why this case was such an excellent guide to the general case.