Of the two, a keg is better. To get the longest storage ability would involve cold-filtering and storing cold in a keg.
But, most HBers don't filter and if you are one, then just try to keep the bottles or keg as close to serving temp as possible while it is stored.
Also it is important when brewing to minimize aeration if you know the beer will be stored for a long time (many months to years).
Keep in mind that if it will only be a few months before the beer is drank then you really don't need to take any "special" precautions when brewing or for storage.
Things to do to extend the shelf life of your beer (basically in order of importance):
1. Store cold - so yeast does not use up it's glycerol reserves as fast and autolyze
2. Get the beer as clear as possible before storing (either by filtering or with finings/extended conditioning time) - rids beer of protiens and yeast in the first place
3. Force carbonate - so you are not making additional yeasts to later die off
4. Store in bulk (keg)
5. If you do prime naturally use corn sugar and not DME - this will make less yeast cells on the bottom that can later, you guessed it, autolyze
There are some other factors but keep in mind I am at the end of a 12 hour night shift and not all are coming to me at this moment.
So you see I am doing a lot of blabbering about tradeoffs and advice, but the answer to your actual question is: "kegs".
Just realize it is not high on the above list...
I'd recommend a good thick official book about the brewing process like Dave Miller's or John Palmers "How to Brew". It is good to know the reasons for your actions rather than just take a procedural approach to brewing.
Well that was much longer than originally anticipated!
Cheers!