Machine learning enables long time scale molecular photodynamics simulations