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 and Kitay continued to reside together until Gunn's death. While at Stanford he taught a class called "The Occasions of Poetry". 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.
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 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."