This thesis presents a study of the use of two-dimensional metal-organic systems as templates for the organization of metal atoms and clusters on surfaces. We start with a systematic characterization of the metal-organic porous networks formed on Cu(111) by polyphenyl-dicarbonitrile molecules, and of the temperature dependence of the assembly process, leading to a variety of geometrical structures. Using molecules of two different lengths we observe networks with distinct periodicities, and we reveal a competition between the different interactions governing the assembly. We also study the self-assembly of a single molecule magnet on supported graphene, observing the same disposition as in a layer of the molecular crystal, which explains the high magnetic anisotropy measured for the system. The metal-organic template is used to organize metal atoms and clusters in the network pores, obtaining a regular array of clusters with a narrow size distribution. We demonstrate how this approach can be used to produce clusters of different elements, such as Fe, Co and Er, as well as mixed transition metal - rare earth metal clusters. Otherwise, the metal-organic networks can be used to organize Fe atoms under the molecules, in which case a two-orbital Kondo system with a marked spatial dependence is obtained. After characterizing the magnetic properties of Fe atoms adsorbed on bare Cu(111), we use a combination of scanning tunneling spectroscopy, density functional theory and x-ray absorption and dichroism to study the Kondo effect of the Fe-molecule system, identifying the involved magnetic orbitals and demonstrating that they are both Kondo screened.