Granta Books said Gray died Wednesday in London. He had been diagnosed with cancer last year.
Gray wrote more than 30 plays, including "Quartermaine's Terms," "Otherwise Engaged" and "The Old Masters," as well as five novels and the screenplay for the 1987 film "A Month in the Country."
A rakish figure who claimed to have consumed three bottles of champagne a day for years, Gray also was steeped in the academic world.
Born in Hampshire, southern England, on Oct. 21, 1936 and educated at Canada's Dalhousie University and the University of Cambridge, Gray taught English for many years at the University of London's Queen Mary college.
Universities provided the setting for several of his best-known plays, including "Butley," the story of a dyspeptic English professor in meltdown that was turned into a movie starring Alan Bates, and "The Common Pursuit," about the aspirations and disappointments of a group of students working on a literary magazine.
In 1995, the West End run of Gray's play "Cell Mates" was famously curtailed when star Stephen Fry suffered a breakdown and disappeared, turning up several days later in Belgium. As was his habit, Gray turned the misadventure into material, writing a book about the episode, "Fat Chance."
Although Gray's plays about the misadventures of middle-class intellectuals sometimes seemed to have gone out of fashion, he was respected by heavyweight collaborators including playwright Harold Pinter, who directed several Gray works, and Bates.
Several of his plays have had successful recent revivals. "Butley" was staged on Broadway in 2006 with Nathan Lane in the title role, and "The Common Pursuit" received strong reviews at London's Menier Chocolate Factory this year.
In recent years, Gray gained a new following for a series of frank and witty memoirs — including "The Smoking Diaries," "The Year of the Jouncer" and "The Last Cigarette" — chronicling his battles with theater producers, alcoholism and a 60-a-day cigarette habit.Gray is survived by his wife Victoria, and by a son and daughter from his first marriage.