Porphyry copper deposits consist of low-grade stockwork and disseminated sulfide zones that contain characteristic vein generations formed during the evolution of the magmatic-hydrothermal systems. The present contribution proposes an interpretive framework for the formation of porphyry veins that is based on quartz solubility calculations in the H2O-NaCl system at temperatures of 100° to 1,000°C and pressures of 1 to 2,000 bar. The model predicts that high-temperature (≳500°C) quartz in A veins of deep (≳4 km) porphyry deposits forms as a result of the cooling of ascending intermediate-density fluids at lithostatic conditions. In deposits of intermediate depths (~1.5–4 km), A vein quartz is mostly formed through cooling of ascending hydrothermal fluids under closed-system conditions or quasi-isobaric cooling under open-system conditions within the two-phase field of the H2O-NaCl system. In shallow (≲1.5 km) porphyry deposits, rapid decompression can also result in quartz precipitation, forming so-called banded veins. The high-temperature quartz in A veins is associated with potassic alteration. During continued cooling of the magmatic-hydrothermal system, quartz is formed at intermediate temperatures (≳375°–500°C). This quartz overprints earlier A veins and forms B veins. The fluid inclusion inventory of this quartz generation suggests formation at fluctuating pressure conditions, marking the lithostatic to hydrostatic transition, and the change of wall-rock behavior from ductile to brittle conditions. The quartz is precipitated because of cooling and decompression of the magmatic-hydrothermal fluids under K-feldspar-stable conditions. Textural evidence from many porphyry veins suggests that hypogene sulfide minerals present in A and B veins postdate the quartz, as contacts between quartz and sulfide minerals commonly show dissolution textures. Hypogene sulfide minerals in C veins form at conditions of retrograde quartz solubility, explaining why these veins contain little to no quartz. The quartz solubility calculations suggest that C vein formation occurs at temperatures of ~375° to 450°C from low-salinity, single-phase fluids escaping from the lithostatic to the hydrostatic environment. At the upper end of this temperature range, C veins are biotite stable. However, these veins are associated with chlorite, chlorite-K-feldspar, or chlorite-sericite alteration in most deposits. Late quartz is formed during continued cooling of the hydrothermal fluids at ≲375°C within the single-phase field of the H2O-NaCl system as quartz solubility under these conditions decreases with temperature. This process is responsible for the formation of quartz in D veins and later base metal-bearing E veins, which are associated with phyllic, advanced argillic, or argillic alteration.