The interplay of superconductivity and magnetism is investigated for systems with dimensions ranging from the mesoscopic to the atomic scale by scanning tunneling microscopy (STM) at millikelvin temperatures and by numerical calculations. Based on geometrically confined superconductors in magnetic fields, a novel STM approach is introduced to quantitatively probe the spin polarization of tunneling electrons. In the first part of this work, the effects of magnetic fields and geometrical confinement are probed for superconducting vanadium STM tips. Due to the unique confinement ranging from the atomic to the mesoscopic scale, the superconducting properties of the STM tips vary considerably from their bulk counterparts. To analyze the experimentally determined magnetic field dependence of several V tips, the superconductivity is numerically calculated for modeled cone geometries with various opening angles. The numerical approach based on a one-dimensional Usadel equation leads to a direct correlation between the opening angle ¿ and the order of the superconducting phase transition. First order phase transitions occur when the opening angle is smaller than a critical value (¿ < ¿c), whilst larger opening angles (¿ > ¿c) result in second order phase transitions. The comparison of experimental findings and numerical results reveals the existence of first and second order quantum phase transitions in the V STM tips. In addition, the numerical calculations also explain experimentally observed broadening effects of the superconducting spectra by the specific tip geometry. In the second part, the superconducting V tips are employed in a novel approach to quantitatively probe the spin polarization of tunneling electrons on the nanoscale. For this purpose, the Meservey-Tedrow-Fulde technique is transferred to STM in order to combine their virtues, such as the quantitative probing capability of the spin polarization, the precise control at the atomic scale and the well-defined vacuum tunnel barrier. To demonstrate the capabilities of the new technique, the local spin structure is resolved for a magnetic Co nanoisland, where spin polarizations ranging from -56% up to 65% were found, depending on the local position. Furthermore, the spin polarization P strongly varies with the tip-to-sample distance z (dP/dz ¿ 10%/Å), which is described by the different decays of the spin-up and spin-down wave functions into the vacuum tunnel barrier. The final part describes the local interaction between isolated magnetic moments and the superconducting ground state. Copper phthalocyanine molecules on the superconducting V(100) surface induce bound states within the superconducting gap due to the magnetic coupling and the Coulomb potentials. Spatially resolved measurements reveal the non-isotropic structure of the spectral weights that is explained by the adsorption site on the 5x1 reconstruction of the V(100) surface. The quasi-particle excitations are not only observed on the magnetic molecule but also occur in its close vicinity. With increasing distance from the molecular structure, the intensities of the bound states decay within the distance x ¿ ±30Å and show periodic oscillations at the same time. Comparing the experimental findings to a one-dimensional model suggests the presence of a complicated scattering potential, which can be simplified by assuming two point scatterers within the molecular structure.