This thesis comprises the study of two types of 2D materials, those stabilized by non-covalent and those by covalent interactions. They are synthesized and studied on well-defined metallic surfaces in ultra-high vacuum (UHV). The self-assembly of terephthalic acid (TPA) on Ag(100) is explored. TPA stays intact upon deposition at room temperature (RT) and forms islands stabilized by hydrogen bonds. TPA islands influence the homoepitaxial growth of silver and reduce the sticking coefficient of Ag atoms. At RT Ag atoms intercalate TPA islands which are not disrupted. In contrast, TPA molecules in conjunction with Mg atoms on Ag(100) results in tip-induced altering of the surface. The electric field between tip and sample interacts with Mg atoms and TPA, which leads to a restructuring of the step-edges during scanning. Moreover, the self-assembly of the organic semiconductor 2,7-dicyano[1]benzothiene[3,2-b]benzothiophene (cBTBT) on Ag(111) at RT is presented. The pro-chiral molecules form compact islands with a chevron-like structure containing both enantiomers. Deposition of Fe atoms leads to an amorphous metal-organic coordination network (MOCN). Statistical analysis reveals that conformational entropy plays a critical part in its stabilization. Phase segregation into spatially homogeneously crystalline domains of molecules and metal atoms upon annealing suggests that the amorphous network is kinetically trapped at RT during the preparation process. The second part presents the on-surface synthesis of 2D polymers via different coupling schemes. First, the Ullmann coupling on Au(111) is explored. The molecule 1,3,5-tris(4-bromophenyl)benzene (TBPB) debrominates upon annealing and polyphenylene is formed. To investigate the influence of metal substrates on the dehalogenation, a single layer of hexagonal boron nitride as well as graphene grown on Ni(111) is introduced. On both surfaces TBPB forms self-assembly islands stabilized by halogen bonds, while on bare Ni(111) the substrate-molecule interaction dominates resulting in structures without long-range order. Upon annealing on both surfaces dehalogenation is induced and 2D nanostructures are formed. On bare Ni(111) the precursor molecules merely decompose. The experimental annealing temperatures are consistent with debromination barriers calculated by DFT. An example of the synthesis of tailor-made 2D structures by using particularly designed precursor molecules is also given. A terminal alkyne with a triazine core undergoes on-surface Glaser coupling and cyclotrimerization on Au(111) resulting in nitrogen doped 2D polymers. Finally, a comprehensive study of the on-surface decarboxylation reaction of 1,3,5-tris(4-carboxyphenyl)benzene (TCPB) on Cu(111) is presented. TCPB deprotonates upon deposition on Cu(111) at RT and self-assembles in compact islands. The self-assembly is stabilized by ionic hydrogen bonds between deprotonated and negatively charged oxygen atoms and hydrogen atoms of neighboring molecules. Annealing leads to decarboxylation and formation of 2D nanostructures. The reaction occurs in a clean fashion because CO2 leaves the surface. In addition, STS reveals that the lowest unoccupied molecular orbital (LUMO) of the 2D polymer is destabilized compared to the LUMO of the monomer although the pi-electron system is more extended in the polymer. The decarboxylation impacts the energy position of the LUMO to a greater extend which is corroborated by DFT calculations.