We present three-dimensional simulations of the dynamical bar-mode instability in magnetized and differentially rotating stars in full general relativity. Our focus is on the effects that magnetic fields have on the dynamics and the onset of the instability. In particular, we perform ideal-magnetohydrodynamics simulations of neutron stars that are known to be either stable or unstable against the purely hydrodynamical instability, but to which a poloidal magnetic field in the range of 10 14 -10 16 G is superimposed initially. As expected, the differential rotation is responsible for the shearing of the poloidal field and the consequent linear growth in time of the toroidal magnetic field. The latter rapidly exceeds in strength the original poloidal one, leading to a magnetic-field amplification in the the stars. Weak initial magnetic fields, i.e., 10 15 G, have negligible effects on the development of the dynamical bar-mode instability, simply braking the stellar configuration via magnetic-field shearing, and over a timescale for which we derived a simple algebraic expression. On the other hand, strong magnetic fields, i.e., 10 16 G, can suppress the instability completely, with the precise threshold being dependent also on the amount of rotation. As a result, it is unlikely that very highly magnetized neutron stars can be considered as sources of gravitational waves via the dynamical bar-mode instability.