Optimization with time-dependent partial differential equations (PDEs) as constraints appears in many science and engineering applications. The associated first-order necessary optimality system consists of one forward and one backward time-dependent PDE coupled with optimality conditions. An optimization process by using the one-shot method determines the optimal control, state and adjoint state at once, with the cost of solving a large scale, fully discrete optimality system. Hence, such a one-shot method could easily become computationally prohibitive when the time span is long or time step is small. To overcome this difficulty, we propose several time domain decomposition algorithms for improving the computational efficiency of the one-shot method. In these algorithms, the optimality system is split into many small subsystems over a much smaller time interval, which are coupled by appropriate continuity matching conditions. Both one-level and two-level multiplicative and additive Schwarz algorithms are developed for iteratively solving the decomposed subsystems in parallel. In particular, the convergence of the one-level, non-overlapping algorithms is proved.The effectiveness of our proposed algorithms is demonstrated by both 1D and 2D numerical experiments, where the developed two-level algorithms show convergence rates that are scalable with respect to the number of subdomains.