It really depends on the tune for me.
A few months back I literally stepped out the front door to do some every day tasks, like the shopping for the week, and a riff came into my head. As I walked I built it up and arranged another riff to follow the first. I done my shopping and walked back home, in this time I made up a chorus and bridge part.
The whole thing appeared to me from nowhere in the space of 1 hour.
I had the demo recorded that night...with no vocals, which I never do.
Then again I have riffs in my head that I've remembered then forgotten, then remembered again for a few years and never recorded.
It could take me 3 to 4 hours making up the drum tracks on my machine and writing down the sequence then recording it. The bassline very rarely strays much from my main guitar riffs anyway, so that usually takes about 1 hour to record.
The guitar parts on the other hand can be an arse. I don't rehearse stuff...as soon as I figure out the riffs, I begin recording. This means I make mistakes, lose count in my head, play the wrong riff at the wrong time, fret it all wrong blah blah blah. This could take 2 to 3 hours also, lol.
A bit of a kick in the teeth when you spend an entire week working on one basic demo then realising the damn thing is only 3 minutes long!!!
Like others have said, I work on stuff while I'm at work also...just running the riffs round my head, and figuring out the changes or whatever there and then.
Meh, like I've sort of said...some songs find their way out my head and onto my Multitracker in a matter of hours...and others can take days.
I find it very frustrating doing it, but when I'm not doing it I feel I NEED to be doing it.
A very odd process for me.
PS - These times are rough estimates....I never actually time myself. I just let it run it's course.