Though there are far more knowledgeable brewers on the forum to answer this question I'll give it my best :thumb:
There are many factors that affect the formation of a good head on a pint, some are embedded in the making of the beer itself, others the way it's served, so lets tackle a few starting with serving...that's easiest.
Clean glasses, any amount of grease on the glass will severely impact on the pints head.
It's actually possible to see the pints head vanish after a 1st sip depending on the tasters lips and what they've been eating beforehand, lipstick etc!...ooh err missus :lol:
Head, the formation of. It's simply not possible to get the same head as you get in the pub other than by using a beer engine at home. Using taps (like the ones I have(enodis)) gives a good head but the bubbles are far too large to be sustained, and the level of agitation in the beer is far too low to give the creamy 'taste' you associate with cask ale at the pub. A way of maximising your pints head at home is to use a nucleated glass. You could always try pulling a volume of beer into a large syringe and then pushing it back into the pint (aka a pocket beer engine, (ask Aleman if unsure))... this simple method will starkly illustrate the difference between a bottle and cask pint...believe me
Most home brew beers are served over carbonated. The first thing you'll seen done at a beer judging event is the beer being poured from a reasonable height to knock some of the C02 out. If you want to try this at home, pour 2 pints at the same time, drink one as is, leave the other one for a while, see if they taste the same.
The brewing. The actual contents of your grist can dictate the head before you've even brewed the beer, though ironically fatty grists can also give the best heads (stouts containing oats etc)
IME, the key to a tight/creamy/long lasting head is two fold. The beer has to be well made and it HAS to be served through a beer engine. If you ever get the chance, pull a shop bought bottled pint through a beer engine at home, and then taste it against the bottle poured into a glass....you won't think they're the same product :shock:
As most of us don't have beer engines at home we have to 'make do' with the way we serve our beer (from the bottle or keg) and it'll do most of the time
As for time affecting the head of the beer, the simple answer is yes, the problem is that a more complicated answer is probably impossible at this time. A lot of the brewing process is still unknown scientifically, and I would imagine long term conditions are at the very bottom of the list of commercial brewers to do's list, it's all about getting it out to market as soon as possible