Clean and lubricate every time before long term storage (to me that's stored for 1 month or more without usage).
I'm far more concerned about parts breakages rather than getting things super clean. I clean until I can inspect to see if parts are cracked, such as a the bolt, cam pin, firing pin for an AR15. Manufacturing flaws do exist and even the best QC practices let bad parts slip by. Moving parts require lubrication more so than spotless cleaning. No white glove cleaning for me.
Barrel gets cleaned roughly every 1k rounds. The chamber gets cleaned for with a soaked patch wrapped around a chamber brush after every range trip (more important for a semi-auto than a bolt gun).
Some people feel like they need to clean or run a wet patch down the barrel after every shot for like 5-10 for " barrel break-in," which to me is superstitious nonsense. If your firearm becomes dirty (dropped in mud, sand, etc.) and is malfunctioning, that's when you should clean while at the range or if you're OCD and just want to keep your firearm clean and shiny. If it's basically carbon build up on moving parts that is causing malfunctions, take a paper towel and do a quick wiping to remove carbon then reapply some lubrication.
If everything is working fine and you're into a long range session with high round count, reapply lubrication on moving parts as necessary.