Use the datepart function of SQL. See
DATEPART (Transact-SQL)[
^]
As example
Select case when datepart(hh, start_time) > 10 or datepart(hh, starttime) < 5 then 'Out of hours' else ' work hours' end as x from XXX
This assumes you are using a datetime field. The area to be careful with is the end date because the exact time of 6am will not be included but 5:59:59 will be.
If you really need 6:00:00 you will need to extent the query in a similar manner to include 6:00:00 but excluded anything beyond 6:00:00