We investigate the time-dependent Casimir-Polder potential of a polarizable two-level atom placed near a surface of arbitrary material, after a sudden change in the parameters of the system. Different initial conditions are taken into account. For an initially bare ground-state atom, the time-dependent Casimir-Polder energy reveals how the atom is "being dressed" by virtual, matter-assisted photons. We also study the transient behavior of the Casimir-Polder interaction between the atom and the surface starting from a partially dressed state, after an externally induced change in the atomic level structure or transition dipoles. The Heisenberg equations are solved through an iterative technique for both atomic and field operators in the medium-assisted electromagnetic field quantization scheme. We analyze in particular how the time evolution of the interaction energy depends on the optical properties of the surface, in particular on the dispersion relation of surface plasmon polaritons. The physical significance and the limits of validity of the obtained results are discussed in detail.PACS numbers: 34.35.+a -interactions of atoms with surfaces; 42.50.Nn -quantum optical phenomena in conducting media; 73.20.Mf -surface plasmons A striking feature of the quantum nature of the electromagnetic field is the existence of a vacuum energy and of zero-point fluctuations. Field fluctuations have observable effects such as the Lamb shift, spontaneous emission, Casimir-Polder forces, and the Casimir effect [1][2][3][4]. In particular, Casimir-Polder forces are long-range electromagnetic interactions between neutral polarizable atoms or molecules (van der Waals interaction), or between an atom and a macroscopic object, that arise from the zero-point fluctuations of the electromagnetic field and matter [5][6][7]. Their prediction is arguably one of the most important results of quantum electrodynamics. The macroscopic counterpart of the Casimir-Polder forces is the Casimir effect, predicting an attractive force between two parallel uncharged plates [8]. The relation between the Casimir effect and Casimir-Polder forces has been extensively investigated in the literature, highlighting fundamental properties such as the nonadditivity [1, 9] and fluctuations (see Ref.[10] and references therein). Experiments conducted from the second half of the nineties to now, have incontrovertibly shown the reality of these rather counterintuitive effects [3,4,11,12]. It is now recognized that the Casimir effect plays an important role in the operation of micro-and nano-electromechanical devices (MEMS and NEMS) [3,4,13]. In particular, the research of experimental setups that allow for a modulation of the intensity or the sign of the force is of great interest as it may help to prevent the jamming ('stiction') of such machinery due to attractive forces, leading to the * Electronic address: harald.haakh@mpl.mpg.de breakdown of the device. In the field of miniaturized atom traps, the control over the Casimir-Polder attraction is desirable to ach...