More often than not, I'll stumble upon a riff or chord progression that sets a mood. This then triggers some type of melody (I'll normally hum a melody line or sing lyrics that have no meaning - just to zero in on a melody that works)which in turn gets me thinking about "real" lyrics. If I really think I have something worth developing, I'll keep at it and eventually a verse, a chorus or some other lyrical hook will develop. From there it is a matter of re-writes to fine tune the basic lyric structure, melody and chord progression.
As I work on the re-writes, a general song structure will develop which often dictates certain aspects of the arrangement. By the time I'm ready to record I already have a fairly well developed idea of what the whole song will sound like - however, once I start to record I often find various harmony factors, hooks, etc. that support the song.
I often find that the basic song developes within anywhere from 15 minutes to an hour. After that it may be many hours of playing the song over and over, changing a word here and there, adding passing chords, etc.