We present a wave packet propagation-based method to study the electron dynamics in molecular species in the gas phase and adsorbed on metal surfaces. It is a very general method that can be employed to any system where the electron dynamics is dominated by an active electron and the coupling between the discrete and continuum electronic states is of importance. As an example, one can consider resonant molecule-surface electron transfer or molecular photoionization. Our approach is based on a computational strategy allowing incorporating ab initio inputs from quantum chemistry methods, such as density functional theory, Hartree-Fock, and coupled cluster. Thus, the electronic structure of the molecule is fully taken into account. The electron wave function is represented on a three-dimensional grid in spatial coordinates, and its temporal evolution is obtained from the solution of the time-dependent Schrödinger equation. We illustrate our method with an example of the electron dynamics of anionic states localized on organic molecules adsorbed on metal surfaces. In particular, we study resonant charge transfer from the π* orbitals of three vinyl derivatives (acrylamide, acrylonitrile, and acrolein) adsorbed on a Cu(100) surface. Electron transfer between these lowest unoccupied molecular orbitals and the metal surface is extremely fast, leading to a decay of the population of the molecular anion on the femtosecond timescale. We detail how to analyze the time-dependent electronic wave function in order to obtain the relevant information on the system: the energies and lifetimes of the molecule-localized quasistationary states, their resonant wavefunctions, and the population decay channels. In particular, we demonstrate the effect of the electronic structure of the substrate on the energy and momentum distribution of the hot electrons injected into the metal by the decaying molecular resonance.