We study the dynamics of photonic quantum circuits consisting of nodes coupled by quantum channels. We are interested in the regime where time delay in communication between the nodes is significant. This includes the problem of quantum feedback, where a quantum signal is fed back on a system with a time delay. We develop a matrix product state approach to solve the Quantum Stochastic Schr\"odinger Equation with time delays, which accounts in an efficient way for the entanglement of nodes with the stream of emitted photons in the waveguide, and thus the non-Markovian character of the dynamics. We illustrate this approach with two paradigmatic quantum optical examples: two coherently driven distant atoms coupled to a photonic waveguide with a time delay, and a driven atom coupled to its own output field with a time delay as an instance of a quantum feedback problem.