Mr Glanville won 69% of the votes cast and was already acting mayor.
Prior to Thursday's by-election he had been deputy mayor of the borough.
Green Party candidate Samir Jeraj came second in the election with 13%.
Labour currently control the borough of Hackney with a majority of 43 seats.
The by-election was called after former Hackney mayor Jules Pipe stood down after 14 years.
Mr Pipe will work with London mayor Sadiq Khan in City Hall as the city's deputy mayor for planning, regeneration and skills.
Labour's Phillip Glanville has comfortably won the race to be the new mayor of the London borough of Hackney.