If the Lie algebra $\mathfrak{g}$ can be realized as the tangent space of a compact Lie group $G$, then all the possible central extensions of $\mathfrak{g}$ are in one to one correspondence which the second de Rham cohomology group of $G$. The reason that $G$ needs to be compact is apparent when you consider the construction of how closed 2-forms are turned into central extensions. By "averaging" them over the group, via integration, you can ensure that they are left invariant, hence corresponding to central extensions. However, if $G$ is not compact then this "averaging" procedure doesn't work.
This is a very broad question, but is there any topological property of non-compact Lie groups that controls the possible central extensions of the Lie algebra?
For instance, the Galilei group (the group of 3D translations, rotations, and non-relativistic "boosts" $x \mapsto x + vt$) is closely related to the Poincare group (the group of 4D translations, rotations, and relativistic "boosts") however the Lie algebra of the Galilei group has one possible central extension, while the Poincare algebra has no central extensions. Is there any way this can be understood as some difference in the global topology of these two groups?