Piers Mackesy was born in Cults, near Aberdeen in Scotland, the son of Major-General Pierse Joseph Mackesy and Leonora Cook. Growing up in an army family, he followed his father's assignments and lived on a number of army posts, including Quetta, Chatham, and Borden. He was educated at Wellington College and was commissioned into the Royal Scots Greys in 1944, serving until 1947. Subsequently, he became a scholar of Christ Church, Oxford, obtaining his bachelor's degree in 1950. As a graduate student, he studied for his D.Phil. degree at Oriel College, Oxford, where he wrote his thesis on British Strategy in the Mediterranean, 1803–1810.
Upon completion of his doctorate, Mackey was appointed Harkness Fellow at Harvard University, and in the following year he was appointed tutor in modern history and Fellow of Pembroke College, Oxford in 1954, remaining there until he retired in 1988. While at Pembroke, he became senior tutor and vicegerent of the College. For many years, he taught the special subject in military history at Oxford with Professor N. H. Gibbs. This course of study involved using the War of the Second Coalition as a case study for examining the theories of Carl von Clausewitz. He remains an Emeritus Fellow of the College.
Mackesy was visiting fellow, Institute for Advanced Study in Princeton (1961–1962), visiting professor, California Institute of Technology (1966), Bland-Lee Lecturer at Clark University, the Naval War College, the U.S. Military Academy, and Northeastern University. He was the Lees Knowles Lecturer at Cambridge University in 1972, and served as a member of Council, Institute of Early American History and Culture, Williamsburg, Virginia, 1970–1973.
In 1978 the University of Oxford awarded Mackesy the degree of D.Litt.; in 1988 he was elected a Fellow of the British Academy.