Gregory was born in Kyneton, Victoria, where he was educated. He opened a tinsmithing and ironmongering business at Rochester aged 16, but 1892, with his business failing, went to Western Australia to prospect on the goldfields with little success. He worked for the Askin & Nicholson storekeepers at the Ninety-Mile camp on the Menzies road before relocating to Menzies township in December 1894. He was the proprietor of two hotels, the Pioneer Hotel and Menzies Hotel, floated two mining companies in 1896, opened the North Coolgardie Herald & Menzies Times newspaper in 1896 and bought out its rival the Menzies Miner in 1898. He was also often described in profiles as having been variously a hotel, stock and share broker at Menzies. He was chairman of the Menzies Progress Committee and became the first mayor of the new Municipality of Menzies from 1896 to 1897. He was appointed as a justice of the peace in 1897. He was also involved in the formation of an "Anti-Asiatic League" at Menzies, and advocated for the quarantining of all arrivals from Asia. Later in life, he would serve as the Western Australian representative on the Australian Board of Control for International Cricket.
State politics
In 1897, he was elected to the Western Australian Legislative Assembly as the member for the new seat of North Coolgardie, narrowly defeating future federal MP Hugh Mahon in a bitter contest, and transferred to the Menzies electorate in 1901. He was promoted to the ministry as Minister for Mines in the short-lived First Leake Ministry of 1901; he subsequently returned in the Second Leake Ministry later that year. Gregory then served in the ministry continuously until his defeat in 1911, as Minister for Mines 1901–1904, Minister for Mines and Railways 1905–1911, and acting Premier and Treasurer 1910–1911. As Minister for Mines, Gregory consolidated the state's ten pieces of mining legislation into one consolidated act, reportedly colloquially known as "Gregory's Act", established the Kalgoorlie School of Mines, made numerous reforms to the mining leases system, and introduced the system of building state batteries to process gold. In 1904, while Minister for Mines, Kalgoorlietabloid newspaperThe Sun made allegations about Gregory's handling of a mining lease dispute, leading to the landmark imprisonment of its editor, John Drayton under parliamentary privilege after Drayton refused to appear before a parliamentary committee into the incident. Gregory lost his seat at the 1911 election, at which the Ministerialists were badly defeated by Labor. He had reportedly grown considerably more conservative during his time in state politics, contributing to his eventual defeat. He attempted to re-enter parliament at a by-election for the Metropolitan Suburban electorate of the Legislative Council the following month, but was again defeated. Following the loss of his state seat, he spent two years farming on a 6000-acre pastoral property 30 miles east of Wickepin.
Federal politics
In 1913, Gregory was elected to the Australian House of Representatives as the member for Dampier, representing the Commonwealth Liberal Party. In 1917, together with the rest of his party, he became a Nationalist. In 1920, the Country Party was formed, and Gregory was one of several Nationalist MPs to join it. He was the party's deputy leader from 21 April 1921 until his resignation due to policy differences on 22 February 1922. The abolition of Dampier led him to contest the seat of Swan at the 1922 election, while party colleague and member for Swan John Prowse contested the new seat of Forrest. In federal parliament, he was a long-serving member of the Public Works Committee and its chairman from 1917 to 1926. He was also a member of the 1913 Royal Commission on the pearling industry, 1914 Royal Commission into powellized timber and the 1927-28 Royal Commission into the Australian moving picture industry. He frequently clashed with his conservative colleagues over tariff issues to protect Western Australian interests, and in 1932, he advocated a referendum to amend the Constitution to allow Western Australia to set its own customs and excise duties for 25 years; when this did not meet with support, he became a supporter of the 1933 Western Australian secession referendum. Gregory died at Mount St. Evin's Hospital in Melbourne in 1940, aged 80 and then the oldest member of the House of Representatives, following a short illness, although he was said to have been in indifferent health for several years. He was granted a state funeral, held at Melbourne's St Patrick's Cathedral in Melbourne, and buried at Fawkner Cemetery.