I think mechanics are the wrong approach here
You could come up with mechanics for involvement in a religion, or any other institution. Such mechanics have been written for many games, including D&D (though I’m unaware of any for the current fifth edition, and things change too much between editions to really use the older ones), and I’ve heard of them being used and appreciated.
Personally, though, I have always found them very awkward. They are, well, mechanical: fixed, set rules for adding and subtracting from your “piety score” or whatever. They can be gamed and they can be abused. A careful DM can prevent outright abuse, but it’s difficult to know where to draw the line—and even more difficult for players to know where you’re going to draw the line. Few people would consider toeing the line, and the DM carefully monitoring it, to really be in the spirit of D&D; it’s not the sort of thing most people are looking for from the game. But then you kind of get into issues where the person who guesses closest to the line has something of an advantage.
In the end, you have to trust your players, and your players have to trust you. That’s all it comes down to, and at that point... the rules don’t really add very much. They add complexity and, perversely, uncertainty, and provide little value.
Also, keep in mind that characters are more than just what’s portrayed at the table
Dungeons & Dragons necessarily assumes a whole lot of “background” activity that rarely comes up in actual play. Warriors’ care and upkeep of equipment, wizards’ studying of tomes and arcane theory, and yes—cleric’s, and others, prayer and meditation. Most games, most of the time, will have morning be something like “OK, you wake up, you all do your things to get ready, Cleric, what spells have you prepared today?”
This is an important part of the game—abstraction. It’s actually an important part of any game. Without abstracting away the details, you wouldn’t have a game at all—you’d have reality. Abstractions are what make a game manageable and playable. They keep the game moving.
So it is very much a feature, not a bug, that characters can be (not saying must be) pious in a way that doesn’t show up “on screen” much. It can be as simple as, when a new character is introduced, asking about their routine, how they spend their time, just asking how religious or not they are. If their faith has weekly services, do they make a point of attending? Only on particularly important days? Does their character meditate in the morning, or say prayers before bed? What about before meals? Do they attempt to lead the rest of the party in prayers—and if so, are they proselytizing their own faith or are they making an effort to make the prayer inclusive of everyone?
You can ask as many or as few questions as you think is appropriate to your campaign and what you need to know about their character. You can be specific and leading—as in my examples—or you can leave your questions broad and open-ended, taking how the player characterizes the character’s faith as representative. If the player doesn’t put much thought or detail into it, that could imply that their character doesn’t put a lot of thought or attention into their faith. (Be wary, though, of punishing the player and/or character for the player not having the same interests that their character does—it is entirely reasonable for someone who is not religious to play a religious character.)
Those answers might happen only when the character is introduced. They might be written down on a character sheet and/or in your notes, and never come up again. They might be purely background details. And that’s OK.
The real question is how to bring religion into the foreground
You characters’ background faith as being a problem for your campaign—but as I was just saying, it isn’t really a problem at all. It’s good for that stuff to be happening in the background. I don’t think you really want a game where the players have to be carefully dotting every i and crossing every t in order to score faith points—or worse, be punished for failing to do so, forcing them to bog the game down with constantly reinforcing their characters’ routine behaviors. The real problem is that this background faith is staying in the background.
But you’re the DM—you control the world. If faith is a very-important part of the world, then make it come up. Have NPCs ask PCs about their faith—as a matter of course, like this is as basic a question as asking about the weather or their trip into town. If NPCs share a faith with any of the PCs, have them greet those PCs appropriately—including, if someone’s been shirking attendance at services, calling them on it. Or avoid calling them on it, tip-toeing around the issue because they perceive it as embarrassing and rude to call out. And some NPCs will be rude, and call out not only the PCs but those NPCs who avoided mentioning it. These are ways that real-world people bring up their faiths in real-world situations, and it’s how you can do so here.
Have events happen at religious services. Religious services are also community gatherings—they’re where news is shared and opinions gathered. Have NPCs who want the PCs help invite the PCs to the weekly service so they can talk to everybody—because everybody will be there. Or have things happen when the PCs don’t go, and have the NPCs wonder why they weren’t there—maybe hold it against them, if they feel the PCs should have been there.
Have faiths be at odds. Campaigns often require PCs to balance the vying perspectives of rival factions—that can be churches as easily as it can be nobles, or guilds.
And give players hooks based on their faith. Nudge them to be involved with it—if they’re trying to decide what to do next, who to talk to next, you can mention that services might be a good place for information, or that a priest might be willing to talk to one of the faithful, or what have you. Reward them for noting their faith and bring it up.
You are what you do in the dark
You bring up concerns about how players are approaching things like dungeons, away from NPCs who might be having services and noting the PCs’ presence or absence, who might greet the PCs with a particular blessing, and so on. And yes, PCs can be devout-seeming in public, but ignore it when out in the wild. That’s a valid characterization—so ask your players if it’s an accurate characterization of their PC. Ask them if they are praying over meals, equipment, fallen foes, fallen comrades. Ask them what they usually do. Ask them again in particular instances that might challenge their usual behavior—do they pray for a particularly despicable foe? Do they pray even when time is of the essence?
Players are not their characters. Their characters can do things, and know things, that the players don’t do. Just like the player might not be inclined—or even capable—to run around swinging a sword, they may not be inclined—or again, capable, due to not knowing the words or having the time—to say all the prayers their characters are saying. If a player wants to mention that their character says a prayer at various times, that’s great—but if not, that’s fine. Don’t expect players to read your mind, either—if you want to know in a particular circumstance how a character reacts, ask about that.