Assuming you are talking about the "usual topology" on the real numbers (the metric topology defined by the metric d(x,y)= |x- y|) then, yes, that set is both closed and bounded and the Heine-Borel theorem applies, so it is compact.
But it is necessary to specify the topology, not just the set. While the topology I cited above is the "usual" topology, we could also give the set of all real numbers the "discrete" topology which is the metric topology defined by "d(x, x)= 0 but if x\ne y d(x,y)= 1". Then it is easy to show that every set is closed and every set is bounded but the only compact sets are the finite sets. In that topology, [0, 1] is both closed and bounded but is not compact. Obviously, the "Heine-Borel theorem" does not apply in that topology.