Stampacchia was born in Naples, Italy. He obtained his high school certification from the Liceo-Ginnasio Gian Battista Vico in Naples in classical subjects, although he showed stronger aptitude for mathematics and physics.
In 1940 he was admitted to the Scuola Normale Superiore of Pisa for undergraduate studies in pure mathematics. He was drafted in March 1943 but nevertheless managed to take examinations during the summer before joining the resistance movement against the Germans in the defense of Rome in September. He was discharged in June 1945.
In 1944 he won a scholarship to the University of Naples which allowed him to continue his studies. In the 1945-1946 academic year he declined a specialization at the Scuola Normale in the Faculty of Sciences in favour or an assistant position at the Naval Institute at Naples. In 1949 he was appointed as assistant with tenure to the chair of mathematical analysis, and in 1951 he obtained his habilitation.
In 1952 won a national competition for the chair at the University of Palermo. He was nominated Professor on Probation at the University of Genoa later the same year and was promoted to full Professor in 1955.
He married fellow student Sara Naldini in October 1948. Children Mauro, Renata, Giulia, and Franca were born in 1949, 1951, 1955 and 1956 respectively.
Stampacchia was active in research and teaching throughout his career. He made key contributions to a number of fields, including calculus of variation and differential equations. In 1967 Stampacchia was elected President of the Unione Matematica Italiana. It was about this time that his research efforts shifted toward the emerging field of variational inequalities, which he modeled after boundary value problems for partial differential equations.
Stampacchia accepted the position of Professor Mathematical Analysis at the University of Rome in 1968 and returned to Pisa in 1970. He suffered a serious heart attack in early 1978 and died of heart arrest on April 27 of that year.