HI,
Launch Automator, choose Calendar Alarm as the type for your new document.
From the Utilies library, drag a Run AppleScript action into the workflow pane on the right.

Delete all the text in the action.
Type in tell application "Safari" to quit
Click the hammer to compile the script and colour-code it.
Save the workflow, calling it something meaningful like Quit Safari.
This will launch Calendar and create a new calendar called Automator if you don't already have one.
The Quit Safari workflow will be scheduled for the current time and date. Reschedule it, making it repeat every day starting at 17:00. The end time is arbitrary.

Click Done, quit Automator and Calendar, launch Safari and stick around until 5pm 😉