We consider a magnetic Laplacian with periodic magnetic potentials on periodic discrete graphs. Its spectrum consists of a finite number of bands, where degenerate bands are eigenvalues of infinite multiplicity. We obtain a specific decomposition of the magnetic Laplacian into a direct integral in terms of minimal forms. A minimal form is a periodic function defined on edges of the periodic graph with a minimal support on the period. It is crucial that fiber magnetic Laplacians (matrices) have the minimal number of coefficients depending on the quasimomentum and the minimal number of coefficients depending on the magnetic potential. We show that these numbers are invariants for the magnetic Laplacians on periodic graphs. Using this decomposition, we estimate the position of each band, the Lebesgue measure of the magnetic Laplacian spectrum and a variation of the spectrum under a perturbation by a magnetic field in terms of these invariants and minimal forms. In addition, we consider an inverse problem: we determine necessary and sufficient conditions for matrices depending on the quasimomentum on a finite graph to be fiber magnetic Laplacians. Moreover, similar results for magnetic Schrödinger operators with periodic potentials are obtained.