The electronic structure and optical properties of metallic nanoparticles are theoretically investigated front first principles. An efficient implementation of time-dependent density functional theory allows a fully quantum mechanical description of systems large enough to display collective electron oscillations and surface plasmon modes. The results are compared with traditional classical electrodynamical approaches. Different regimes of interest are identified, both where classical electrodynamical models yield accurate descriptions, and where quantum effects are indispensable for understanding plasmonic properties in nanostructures. The limits of validity of classical electrodynamics are clearly established for the study of a variety of relevant geometries