OK.
My boyfriend and I vary between messaging straightaway and messaging a few hours later.
It might help you to think about why this is happening.l so that it stops you from overthinking.
Reasons my boyfriend and I don't reply immediately...
We haven't closed the app so it looks like we're online when we're not.
We are both in group chats that other people are messaging so we are 'online' in the sense that we've quickly opened these up to read/briefly respond to these messages but aren't engaged in a long conversation with them or our attention is taken up by these conversations. Especially if they are entertaining.
We might be chatting to someone we don't speak to often or haven't seen in while.
We might be speaking to our respective children/siblings.
We.might have the mental energy for chatting shit with our mates but not the mental energy for a more serious/mundane chat with each other.
We know we're going to see each other later that day so we arent each others priority at that moment.
Etc...
If he treats you well and these delayed responses are only for a few hours, I really think you're worrying about nothing and falling into the trap of thinking that "if he cared..." you'd be the most important thing to him and the only thing on his mind and he should be desperately missing you and wanting to be in touch constantly. Or at least be constantly available to you.
I had a boyfriend a few years ago who monitored when I was online. More extreme than you because he would message me every time I came offline to someone else to tell me that I'd been online but hadn't messaged him. I dumped him. Not for the messages telling me but for the fact he was monitoring me closely enough to know.
Real and healthy relationships don't work like that.