Many fundamental processes in nature and technology, from the electronic energy transfer in biological photosynthetic complexes to the charge mobility in solid-state photovoltaic devices, involve the dynamics of electrons in complex molecular systems and nanostructures. Therefore, understanding the dynamical characteristics of electronic states is crucial for rational designs of functional materials. To make progresses toward this goal, we have developed time-dependent open-system self-consistent field at second order (OSCF2), a real-time time-dependent functional theory method incorporated with open quantum systems theory. This dissertation focuses on the derivation and implementation of OSCF2, and explores its applicability in realistic, chemically relevant molecular systems. The contribution of the present work is three-fold. First, we derive a new dissipative theory for electrons in energetic contact with the environment that causes the electronic populations to naturally relax to a Fermi-Dirac thermal equilibrium statistics limit. Second, we present a complete implementation of OSCF2 for real-time simulations of chemical systems including the treatment of energy dissipation. The cubic scaling achieved through highly efficient algorithms means OSCF2 is computationally inexpensive compared to existing real-time dynamics codes. We critically assess the validity in numerous simulation studies and demonstrate that OSCF2 consistently produces absorption spectra and non-radiative relaxation rates which are in good agreement with experimental results. Finally, we present the first ab initio simulations of transient absorption spectra spectroscopy. In particular, the transient spectrum and relaxation dynamics of methylammonium lead triiodide perovskite is investigated, substantiating the assignment of induced bleach and absorption signals.