In this work we study the effects of the geometry and topology of a cylinder on the energy levels of an electron moving in a homogeneous magnetic field. We consider the existence of topological defects as a screw dislocation and a disclination. When we take the region of movement as the full cylindrical surface, we find that, by increasing the strength of the screw dislocation, the dispersion on the electronic energy levels is affected and monotonically increasing. For an electron moving in an almost flat region we show that the dispersion on the Landau levels decrease monotonically as we increase the strength of the screw dislocation. The lowest Landau level can reach a zero value, leaving the energy of the system solely given by the geometry of the cylinder, which does not depend on the magnetic field. In both situations, as we change the deficit angle of the disclination, we observe that the energy levels are shifted and the magnitude of such shift depends on the magnetic field. The Landau levels for a flat sample are recovered in the limit of an infinite cylinder radius.