Compactness of a Lie-group is a property of topology, whereas compactness is also defined on Lie-algebras, but in that case it is an algebraic property. A Lie-algebra is called compact if its Killing-form is negative definite. Without going to deeply in the theory of Lie-algebras and Lie-groups, the Killing-form https://en.wikipedia.org/wiki/Killing_form is the bilinear form used on the Lie-algebra, i.e. a kind of scalar product.
In the post of Daniel the Heisenberg group https://en.wikipedia.org/wiki/Heisenberg_group#Heisenberg_algebra is mentioned, that group is nil-potent, it has a nil-potent Lie-algebra https://en.wikipedia.org/wiki/Nilpotent_Lie_algebra . The Killing-form on a nil-potent Lie-algebra is zero, i.e. not at all (neither positive nor negative) definite.
Indeed there exist plenty of compact groups: SU(n), U(n), SO(n), and even Sp(n) and many more. All are real as the group elements are parametrised by real parameters (in case of the well-known rotation group SO(3) is the rotation-vector $\vec{\alpha} =(\alpha_1, \alpha_2, \alpha_3) \in \mathbb{R}^3$.
There is a famous real non-compact group in physics: the Lorentz-group which parametrised by 6 parameters $\vec{\alpha}$ and $\vec{v}$, the latter the 3-velocity. It is a real group as the parametrisation is real. As the parametrisation space of the velocity is open ($\vec{v}$ never reaches speed of light) is obviously non-compact.
For compact groups the representation theory is particularly simple, in particular the matrices representing group elements are unitary. This explains the great interest in compact groups, also as gauge group (Yang-Mills).
Each real and in particular the mentioned compact groups above can be complexified, i.e. means that the scalar multiplication of the corresponding Lie-algebra is done with complex numbers instead of real numbers. For the classification of the Lie-algebras it is easier to consider complex algebras, in particular since the field $\mathbb{C}$ is closed (algebra works "better" on closed fields, example is the for instance the fundamental theorem of algebra that only works on the field of complex numbers).
In the application of groups in physics real groups dominate, but in order to understand the group respectively the Lie-algebra structure it is often easier to consider the complexfied group. There is a completed representation theory of complexified semi-simple Lie-groups https://en.wikipedia.org/wiki/Representation_theory_of_semisimple_Lie_algebras of which compact Lie-algebras is a subset.
Actually the restricted Lorentz-group can be considered as a complex group of 3 complex parameters $z =\vec{\alpha} + i\vec{v}$. It is then called $SO(3,\mathbb{C})$.
However, the Lorentz-group can also be considered as real group with 6 parameters.
As a real group the representation theory of the Lorentz-group is a bit more involved than the representation theory of the complexified Lorentz-group.
More details can be found in textbooks of semi-simple Lie-groups of which the Lorentz-group is one.