We analyze magnetic properties of monolayers and bilayers of chromium iodide, \\documentclass[12pt]{minimal} \\usepackage{amsmath} \\usepackage{wasysym} \\usepackage{amsfonts} \\usepackage{amssymb} \\usepackage{amsbsy} \\usepackage{mathrsfs} \\usepackage{upgreek} \\setlength{\\oddsidemargin}{-69pt} \\begin{document}$$\\hbox {CrI}_3$$\\end{document}, in two different stacking configurations: AA and rhombohedral ones. Our main focus is on the corresponding Curie temperatures, hysteresis curves, equilibrium spin structures, and spin wave excitations. To obtain all these magnetic characteristic, we employ the atomistic spin dynamics and Monte Carlo simulation techniques. The model Hamiltonian includes isotropic exchange coupling, magnetic anisotropy, and Dzyaloshinskii-Moriya interaction. As the latter interaction is relatively weak in pristine \\documentclass[12pt]{minimal} \\usepackage{amsmath} \\usepackage{wasysym} \\usepackage{amsfonts} \\usepackage{amssymb} \\usepackage{amsbsy} \\usepackage{mathrsfs} \\usepackage{upgreek} \\setlength{\\oddsidemargin}{-69pt} \\begin{document}$$\\hbox {CrI}_3$$\\end{document}, we consider a more general case, when the Dzyaloshinskii-Moriya interaction is enhanced externally (e.g. due to gate voltage, mechanical strain, or proximity effects). An important issue of the analysis is the correlation between hysteresis curves and spin configurations in the system, as well as formation of the skyrmion textures.