In all the preceding answers the category $D$ is required to have pushouts / pullbacks in order to epi / mono being equivalent to pointwise epi / mono in functor categories $D^C$.
The discussion in On a corollary in Mitchell's bookOn a corollary in Mitchell's book draw my attention to another important class of categories that usually doesn't have pushouts or pullbacks and where epi / mono is also equivalent to pointwise epi / mono in $D^C$: That is when $D$ is exact.
A category is exact, if
- it has a zero object
- kernels and cokernels exist
- every monomorphism is a kernel and every epimorphism is a cokernel
- every morphism can be written as a composition of an epimorphism followed by a monomorphism.
As a reference see Barry Mitchell: "Theory of Categories", II.11 Functor Categories.