Lightweight magnesium alloys offer excellent benefits over Al alloys due to their high specific strength and damping properties, but they are more prone to galvanic corrosion. Plasma electrolytic oxidation (PEO) coatings reinforced by nanoparticles have been shown to improve corrosion resistance and possess better mechanical properties. A lot of research has been published that focuses on the effect of nanoparticle concentration in the PEO electrolyte solution, and the type of nanoparticle, on the properties obtained. The aim of paper is to study the effect of processing time on the nanoparticle-reinforced PEO coating on AZ31 magnesium alloy. TiN and SiC nanoparticles were produced using plasma chemical synthesis and added to KOH-based electrolyte to develop PEO coatings. The concentration of nanoparticles was kept constant at 0.5 g/L and the treatment time was varied as follows: 1, 2, 3, 5, and 10 min. The coatings were tested for their microstructure, phase, chemical makeup, nano-mechanical properties, and corrosion resistance. Nanoparticles were found to be clustered in the coating and spread unevenly but led to a decrease in the size and number of pores on the PEO coating surface. The corrosion resistance and nano-mechanical properties of the coating improved with treatment time. The hardness and contact modulus of coatings with TiN particles were 26.7 and 25.2% greater than those with SiC particles. Addition of TiN nanoparticles resulted in improved corrosion resistance of the PEO coatings when the processing time was 5 or 10 min. The lowest corrosion rate of 6.3 105 mm/yr was obtained for TiN-added PEO coating processed for 10 min.