Gunn was born in Gravesend, England, the son of Bert Gunn. Both of his parents were journalists. They divorced when he was 10 years old. When he was a teenager his mother killed herself. It was she who had sparked in him a love of reading, including an interest in the work of Christopher Marlowe, John Keats, John Milton, and Alfred, Lord Tennyson, along with several prose writers. In his youth, he attended University College School in Hampstead, London, then spent two years in the British national service and six months in Paris. Later, he studied English literature at Trinity College, Cambridge, graduated in 1953, and published his first collection of verse, Fighting Terms, the following year. Among several critics who praised the work, John Press wrote, "This is one of the few volumes of postwar verse that all serious readers of poetry need to possess and to study."
As a young man, he wrote poetry associated with The Movement and, later, with the work of Ted Hughes. Gunn's poetry, together with that of Philip Larkin, Donald Davie, and other members of The Movement, has been described as "...emphasizing purity of diction and a neutral tone...encouraging a more spare language and a desire to represent a seeing of the world with fresh eyes."
In 1954, Gunn emigrated to the United States to teach writing at Stanford University and to remain close to his partner, Mike Kitay, whom he had met while at college. Gunn taught at the University of California at Berkeley from 1958 to 1966 and again from 1973 to 2000. He was "an early fan" of the radical gay sex documentary zine Straight to Hell.
In 2004, he died of acute polysubstance abuse, including methamphetamine, at his home in the Haight Ashbury neighbourhood in San Francisco, where he had lived since 1960.
During the 1960s and 1970s, his verse became increasingly bold in its exploration of drugs, homosexuality, and poetic form. He enjoyed the bohemian lifestyle in San Francisco so much that Edmund White described him as "the last of the commune dwellers [...] serious and intellectual by day and druggy and sexual by night". While he continued to sharpen his use of the metrical forms that characterised his early career, he became more and more interested in syllabics and free verse. "He's possibly the only poet to have written a halfway decent quintain while on LSD, and he's certainly one of the few to profess genuine admiration for both [Yvor] Winters (the archformalist) and Allen Ginsberg (the arch ... well, Allen Ginsberg)", critic Daniel Orr has written. "This is, even for the poetry world, a pretty odd background."
In classic verse forms, like the terza rima of Dante, he explored modern anxieties:
"It is despair that nothing cannot be
Flares in the mind and leaves a smoky mark
Purposeless matter hovers in the dark." ("The Annihilation of Nothing")
Gunn, who praised his Stanford mentor Yvor Winters for keeping "both Rule and Energy in view, / Much power in each, most in the balanced two," found a productive tension – rather than imaginative restriction – in the technical demands of traditional poetic forms. He is one of the few contemporary poets (James Merrill would be another) to write serious poetry in heroic couplets – a form whose use in the twentieth century is generally restricted to light verse and epigrammatic wit. In the 1960s, however, he came to experiment increasingly with free verse, and the discipline of writing to a specific set of visual images, coupled with the liberation of free verse, constituted a new source of rule and energy in Gunn's work: a poem such as "Pierce Street" in his next collection, Touch (1967), has a grainy, photographic fidelity, while the title-poem uses hesitant, sinuous free verse to portray a scene of newly acknowledged intimacy shared with his sleeping lover (and the cat).
The poet's major stylistic change in his shift toward free verse roughly within a decade that included much of the 1960s, combined with the other changes in his life — his move from England to America, from academic Cambridge to bohemian San Francisco, his becoming openly gay, his drug-taking, his writing about the "urban underbelly" — caused many to conjecture how his lifestyle was affecting his work. "British reviewers who opposed Gunn’s technical shifts blamed California, just as American critics would, later on, connect his adventurous lifestyle with his more 'relaxed' versification," according to Orr, who added that even as of 2009, critics were contrasting "Gunn’s libido with his tight metrics — as if no one had ever written quatrains about having sex before".
In Gunn's next book, Jack Straw's Castle (1976), the dream modulates into nightmare, related partly to his actual anxiety-dreams about moving house, and partly to the changing American political climate. "But my life," he wrote, "insists on continuities — between America and England, between free verse and metre, between vision and everyday consciousness."
The Passages of Joy reaffirmed those continuities: it contains sequences about London in 1964–65 and about time spent in New York in 1970. The Occasions of Poetry, a selection of his essays and introductions, appeared at the same time.
Ten years were to pass before his next and most famous collection, The Man With Night Sweats (1992), dominated by AIDS-related elegies. Neil Powell praised the book: "Gunn restores poetry to a centrality it has often seemed close to losing, by dealing in the context of a specific human catastrophe with the great themes of life and death, coherently, intelligently, memorably. One could hardly ask for more." As a result of the book, Gunn received the Lenore Marshall Poetry Prize in 1993. Although AIDS was a focus of much of his later work, he remained HIV-negative himself.
That year, Gunn published a second collection of occasional essays, Shelf Life, and his substantial Collected Poems, which David Biespiel hailed as a highlight of the century's poetry: "Thom Gunn is a poet of 'comradely love.' Compassion has always been his domain and his work's principal emotion. If 20th century verse written in English can be seen as a battle between memory and voice - between the phenomena and its history, on the one hand, and the poet's conviction and feeling about it, on the other - then Gunn's importance lies in the accuracy with which he unifies the language and emotion of experience. You're not sure where one ends and the other starts. The result is that his poems find the limits of their imaginative territory and then push beyond that." His final book of poetry was Boss Cupid (2000).
In 2003 he was awarded the David Cohen Prize for Literature together with Beryl Bainbridge. He also received the Levinson Prize, an Arts Council of Great Britain Award, a Rockefeller Award, the W. H. Smith Award, the PEN (Los Angeles) Prize for Poetry, the Sara Teasdale Prize, a Lila Wallace-Reader's Digest Award, the Forward Prize, and fellowships from the Guggenheim and MacArthur foundations. He won Publishing Triangle's inaugural Triangle Award for Gay Poetry in 2001 for Boss Cupid; following his death, the award was renamed the Thom Gunn Award in his memory.
Five years after his death, a new edition of Gunn's Selected Poems was published, edited by August Kleinzahler.