There are two levels to this question. If you are using modern whipping cream as a starting point, then the trick for a longer lasting whipped cream is stabilization. If this is some farm bought milk you are skimming the cream from, then you have the additional problem that your cream is not fatty enough. Modern creams are concentrated with a centrifuge.
To get good whipped cream, whip it cold until it doubles in volume and you get firm peaks. Stabilize the whipped cream by hanging it in a cheese cloth in the refrigerator or by adding gelatin.To use the gelatin, dissolve 2 teaspoons of unflavored gelatin into 2 tablespoons of cold water. Work out the lumps. After the gelatin expands, mix in a quarter cup of cream and heat the mixture to dissolve the gelatin. Cool over ice and mix a bit. Complete 2 cups of cream and proceed as you would to finish your whipped cream.
The cream whipper relies on gas expansion to work.
When you make whipped cream by beating, you beat fine air bubbles into the cream. The cream traps air and becomes essentially a matrix that holds those bubbles--a foam.
Your gas-charged whipper does the same thing in a totally different way.
When you charge the whipper with gas, there's high gas pressure inside with the cream. The cream will actually absorb the nitrous oxide you put in. Because of the pressure, the gas absorbed can be thought of as really really really small bubbles within the cream. So you have a matrix of gas and cream, but because the bubbles are so small, it's essentially just cream.
Chilled liquids more easily absorb gases at high pressure, which is why it's good to use cold cream and keep the whole unit in the fridge. A limited amount of agitation (shaking) exposes more cream to the gas, improving absorption.
When you release the cream from the device, the absorbed gas expands rapidly. The bubbles get bigger, and your cream to bubble ratio becomes more like the foam that we know as whipped cream. It's really exactly the same thing, only with nitrous oxide instead of plain ol' boring air inside the bubbles.
Why nitrous oxide? As I understand it, it's because it's the cheapest non-toxic, odorless and tasteless gas you can get. Carbon dioxide would almost be a good choice, but unfortunately it's bitter. Not a good match for cream.
Finally, why is shaking too much a bad thing? That one I don't know for sure, but I know what happens when you over-whip cream with the mixer. You make butter. Perhaps the gas or high pressure encourages this conversion, or maybe you're just churning it that much when you over-shake. Either way, I'm sure you've essentially made butter when you shook it too much.
Best Answer
How long you can store whipped cream for depends on how whipped it is. Lightly whipped cream will start to soften after a couple of hours, stiff whipped cream may last a day or so (in both cases, in the fridge).
When you whip cream, air bubbles are trapped amongst the droplets of fat, giving the cream its light texture. These naturally pop and 'leak' out of the cream over time.
As you guessed, this is one reason (the others being speed and reliability) that commercial kitchens use cream siphons. They force nitrous oxide through liquid cream as it is dispensed, so it's 'whipped' on demand. Cream whipped in this way tastes pretty much like regular whipped cream - nitrous oxide is used precisely because it is flavourless. Using, say, carbon dioxide as in soda would result in sour tasting cream.