Topological insulators (TIs) are narrow–gap semiconductors characterized by Dirac-like surface state and protected by time-reversal symmetry. Magnetic field (external or internal) breaks this symmetry and causes splitting of the topological surface state at the Dirac point thus making the surface insulating. Internal magnetic field in TIs can be created in various ways, in particular, by introducing vacancies or carbon atoms, doping with 3d-transition metal atoms, displaying magnetic semiconductors or organic overlayers as well as bulk materials on the surface of three- or two-dimensional TIs. Magnetic field effect on the TI surface state (SS) can be also realized due to extension of the TI SS into the magnetic overlayer. Here I present and discuss recent results of the study of two-dimensional topological insulators (quantum spin Hall systems) and the effect of magnetic impurities as well as magnetic proximity effects and extended magnetic effect on electronic and spin structure of TIs and splitting of the topological surface state. New method for engineering of heterostructures that results systematically in a big splitting of the Dirac cone is discussed in detail. Magnetic effects in two-dimensional topological insulators and respective heterostructures are also discussed.