Hayes was born in Cork, Ireland and arrived with parents in New South Wales in 1837. He was educated at a private school near Parramatta and became a miller. He married Frances Foott Besnard in June 1861 and had four daughters and six sons. Hayes was elected as a member for the seat of Hume of the New South Wales Legislative Assembly in 1885 and was re-elected each election until 1894, when he switched to the seat of Murray, which he held until 1904. He died in the Sydney suburb of Stanmore.