You are not receiving the badge because you have added the HAVING count(*) >= 100 constraint, so you will only be able to earn the badge if you make more than 100 posts between that time interval.
SELECT
user_id,
current_timestamp granted_at
FROM badge_posts p
WHERE p.created_at::time BETWEEN '02:00' AND '06:00'
GROUP BY user_id
HAVING count(*) >= 100