Superconducting circuits in the quantum regime represent a viable platform for microwave quantum optics, quantum simulations and quantum computing. In the last two decades, a large effort brought this architecture from an academic curiosity to concrete technology. In this thesis, we study the effects of the environment on superconducting circuits. We consider mainly two types of the environments. On one hand, we study the classical baths inevitably coupled to the circuits, in particular the substrate where they are fabricated and the highly attenuated coaxial lines used for controlling them, which are the main sources for decoherence. On the other hand, we study structured electromagnetic environments that shape the density of states for the circuits, modifying their energy structure and their excitation properties. Defects on the substrate mechanically and electrically coupled to superconducting circuits, behave as a bath of two-level systems. We investigate the effects of the bath on qubits fabricated on silicon. From a time trace with more than 2000 measurements of T1 and T2 (every 3 min for 60 h), we statistically infer a Lorentzian resonance signature of the bath. Moreover, measuring the residual population of the first excited state of the qubit, and tuning the photonic population in the line, we assess the thermal state of the bath, measuring a temperature of 42 mK. Furthermore, we investigate the mechanical coupling of the bath, saturating its state, strongly pumping neighbouring modes in a high finesse mechanical resonator. On a piezoelectric substrate, the travelling phonons, carry an electric component together with a lattice deformation. Therefore, superconducting circuits can be coupled to a phononic waveguide through which they release part of their energy. We design, fabricate and measure superconducting resonators on gallium arsenide, demonstrating the electromechanical coupling as the main source of decoherence. Concentrating on the effects of the photonic bath in the coaxial line, we design a qubit with a very large coupling to this bath compared to the bath of two-level systems. In this limit, the scattering of a coherent photon by the qubit linearly depends on the photonic bath population. In this regime, the qubit can be used as a primary thermometer; we measured the photon occupation of our input lines both at different temperatures and injecting calibrated noise. Finally, we implemented a slow-waveguide made of a linear chain of high impedance resonators. The excitation of two transmon qubits coupled to the waveguide is dressed with a photonic component, generating the hybrid excitation of an atom-photon bound state. We spectroscopically investigated the first and second excitation subspaces of the system, and we demonstrated full frequency and time domain control, of these bound states. These results may help to improve the performance of superconducting circuits and their setups. Moreover, we hope that our experiments can provide tools for quantum thermodynamics, quantum simulation and quantum computing.