The authors develop a non-equilibrium quantum theory for atoms with time-periodic cavity-mediated interactions and dissipation by eliminating the photonic modes. Their theory describes accurately the relaxation into stable time-crystalline steady states and is used to predict the phase transition lines.