This thesis is concerned with the theoretical study of the physical characteristics of metallic surfaces. Ab initio quantum calculations are performed to determine the electronic properties of clean elemental metal surfaces, fully accounting for the material's atomic structure. We aim to understand the atomicscale mechanisms responsible for the dependence of the work function on the surface geometry, including the crystallographic orientation of the surface, the atomic relaxation and reconstruction, as well as the effect of surface edges. We present an accurate method to derive work functions from self-consistent thin-film calculations. By applying a technique based on a macroscopic average, we filter the atomic oscillations in the electronic density to measure precisely the electrostatic potential step at the crystal surface. Combining this quantity with the Fermi energy of a bulk crystal is shown to reduce size effects on the work functions and to yield very precise values. The microscopic origin of the work function anisotropy is studied in sodium, aluminium, copper and gold. For these metals, we find that the trends of increasing work functions for the principal surface orientations reproduce the experimental data and that the trend in aluminium is different from most other metals. The origin of the work function anisotropy is discussed in relation with the orbital character of the electronic states at the Fermi energy. Our study of metal surfaces is extended to the facets of a finite crystal. First-principles studies of the electronic structure of nanowires enable us to obtain the electrostatic potential outside a variety of infinitely-long facet edges. In particular, we determine the microscopic mechanism that allows two different work functions to coexist on either side of a facet edge.