Gleeson was born in the Sydney district of Hornsby in 1915 and attended East Sydney Technical College from 1934 to 1936.
In 1938 Gleeson studied at Sydney Teachers College, where he gained two years training in general primary school teaching. Salvador Dalí, Max Ernst, André Masson, Sigmund Freud and Carl Jung became major influence in Gleeson's work.
Gleeson's themes generally delved into the subconscious using literary, mythological or religious subject matter. He was particularly interested in Jung's archetypes of the collective unconscious.
In 1944 Gleeson created The sower referencing Jean-François Millet’s 1850 painting of the same title. Rather than showing a landscape with a conglomerate main figure, Gleeson presents an eerie twentieth-century view of a desolated one. He commented on the work's genesis as a response to the trauma of longtime warfare:
I think that there was always the hope that it could influence the way people thought about war. That it could alert people to its horrors and prevent it occurring again. You see, I was born during the First World War in 1915, and my earliest experiences were with people who were in that war or remembered the war very vividly, and then, just when I was beginning to paint, the Second World War began. So war became a kind of lurking terror in my mind from infancy through to late adolescence, when it was all building up again for another one.
During the 1950s and '60s he moved to a more symbolic perspective, notions of human perfectibility. At this time he increasingly fashioned small psychedelic compositions made using the surrealist technique of decalcomania in the background, to suggest a landscape, and finished by adding a fastidiously painted male nude in the foreground. Many of his paintings had homoerotic undertones, something which reflected on Gleeson's own homosexuality. The ideas for these compositions also saw Gleeson move into collage with his Locus Solus series, where he produced a substantial body of work by placing dismembered photographs, magazine illustrations, diagrams and lines of visionary poetry against abstract pools of ink.
Since the 1970s Gleeson generally made large scale paintings in keeping with the surrealist inscape genre. The works outwardly resemble rocky seascapes, although in detail the coastline's geological features are found to be made of giant molluscs and threatening crustaceans. In keeping with the Freudian principles of surrealism these grotesque, nightmarish compositions symbolise the inner workings of the human mind. Called 'Psychoscapes' by the artist, they show liquid, solid and air coming together and directly allude to the interface between the conscious, subconscious and unconscious mind. Gleeson's later works incorporate the human form less and less in its entirety. The human form was then represented in his landscapes by suggestions, an arm, a hand or merely an eye.
His retrospective in 2004-2005, Beyond the Screen of Sight, included 120 paintings and was exhibited in Melbourne and Canberra. The Art Gallery of New South Wales exhibited Gleeson's drawings for paintings in 2003 and The Ubu diptych in 2005 to celebrate Gleeson's 90th birthday. The Ubu diptych is regarded as one of his greatest.
In September 2007, the largest collection of Australian surrealism ever collected was donated to the National Gallery of Australia by Ray Wilson. The collection included various works by James Gleeson.
Gleeson died in Sydney on 20 October 2008, aged 92. His life partner Frank O'Keefe died in 2007.