Let Pk and Ck denote the directed path and the directed cycle of order k, respectively. In this paper, we determine the precise maximum size of Pk-free digraphs of order n as well as the extremal digraphs attaining the maximum size for large n. For all n, we also determine the precise maximum size of Ck-free digraphs of order n as well as the extremal digraphs attaining the maximum size. In addition, Huang and Lyu [\textit{Discrete Math. 343(5) 2020}] characterized the extremal digraphs avoiding an orientation of C4. For all other orientations of C4, we also study the maximum size and the extremal digraphs avoiding them.