We extend the Runge-Gross theorem for a very general class of open quantum systems under weak assumptions about the nature of the bath and its coupling to the system. We show that for Kohn-Sham (KS) time-dependent density functional theory, it is possible to rigorously include the effects of the environment within a bath functional in the KS potential. A Markovian bath functional inspired by the theory of nonlinear Schrödinger equations is suggested, which can be readily implemented in currently existing real-time codes. Finally, calculations on a helium model system are presented.