We consider the time evolution of the electric and magnetic field operators for a two-level atom, interacting with the electromagnetic field, placed near an infinite perfectly conducting wall. We solve iteratively the Heisenberg equations for the field operators and obtain the electric and magnetic energy density operators around the atom (valid for any initial state). Then we explicitly evaluate them for an initial state with the atom in its bare ground state and the field in the vacuum state. We show that the results can be physically interpreted as the superposition of the fields propagating directly from the atom and the fields reflected on the wall. Relativistic causality in the field propagation is discussed. Finally we apply these results to the calculation of the dynamical Casimir-Polder interaction energy in the far zone between two atoms when a boundary condition such as a conducting wall is present. Magnetic contributions to the interatomic Casimir-Polder interaction in the presence of the wall are also considered. We show that, in the limit of large times, the known results of the stationary case are recovered.