Depends on the gun:
My revolvers, after I shoot them, but definitely with-in 24 hours of firing them.
My rifles, after I shoot them.
My safe residents (Those Who Reside Inside the Safe), every couple of months, I take them out, wipe them down and re-oil or re-grease them.
(Safe Residents currently include: a dozen shotguns, a dozen rifles and a few semi-auto handguns that I am not interested in shooting right now.)
Shotguns: When I get around to them. I had one (Browning 12 gauge, 28" Field Model) that has been kicking around in the barn for a few years. She is uglier than me and more abused than a chicken in a fox den, but has always worked well. I brought her down the house the other day and wiped her down and oiled her. She'll be back in the barn either today or tomorrow.
Sometimes I clean guns that have already been cleaned. I get bored and will break out the cleaning kit and sit and clean the guns while watching tv.