Try something like:
select *
from time_slots ts
where agentid = 7 -- or any agent
and userid = -1 -- it is free
and not exists (select 1 -- and overlaping interval does not exist
from time_slots ts_2
where ts_2.userid <> -1 -- not free
and (ts.datet, ts.datet + interval '1 hour' * ts.duration) OVERLAPS
(ts_2.datet, ts_2.datet + interval '1 hour' * ts_2.duration))