More often than most people think! Every 1-2 weeks is a good rule of thumb.
There are a number of advantages to keeping yours tyres at the correct pressure. However, it is commonly thought that if you don't use the bike the tyres will hold their pressure. This is not true!
Take it from someone who has to go round his bike shop pumping up the tyres of display bike whether they've been ridden or not: Those pesky little air molecules have a habit of escaping from their inner tubes when you least expect it!
It varies from tube to tube. So, for instance, you might find that your front tyre seems to stay harder for longer than your rear tyre. Each tube has its own "personality" like that.
However, if a tyre goes from hard to soft in a matter of days, then it has a slow puncture and you need to replace or repair the inner tube.