To a large extent the start of 'evening' is a matter of opinion or convention. The Oxford Dictionaries say that it 'usually' starts at 'about' 6 PM. Note the lack of a definite rule.
1 The period of time at the end of the day, usually
from about 6 p.m. to bedtime.
it was seven o'clock in the evening
Cambridge does not provide a time:
the part of the day between the end of the afternoon and night
Evening (Cambridge Dictionary)
The BBC seems content to place 5 PM in the 'afternoon', and 6 PM in the 'evening':
The bombing in Norwich began on Tuesday July 9th 1940 at five o'clock in the afternoon
WW2 People's War (BBC)
Like me, she refuses to work after six o’clock in the evening.
BBC (Learning English)
I personally would find the greeting or farewell 'Good evening' too early for 5pm, and fine for 6pm. If I wanted to say a pleasant farewell to a colleague at close of business for the day (in my case 3.30pm), I would probably say 'I hope you have a good evening'.