He was the second son of the famous Dutch theologian Johannes Hermanus Gunning (1829-1905) and his wife Johanna Jacoba Gunning. JWB attended the University of Amsterdam, Leiden University and Jena University, qualifying as a doctor of medicine. In 1884 he started a practice in the Orange Free State. He met and married Susanna Neethling (26 April 1862 - 14 May 1889) on 10 November 1884. From the Free State, he moved to the Cape Colony and practised there until 1897 when he was appointed as first director of the Staatsmuseum (State Museum) in Pretoria, which later was renamed the Transvaal Museum. He remained director until his death in 1913. Gunning was responsible for founding the National Zoo in Pretoria in 1899.
On the death of his first wife, he married Ellen Elizabeth Dobbin (born 30 December 1867) of Bethulie on 19 November 1889. She was the daughter of William Rouse Dobbin and Emma Elizabeth Kirkham.