How close should you stand to the table? Much of this depends on your playing style. Most new players tend to stand too close to the table. This leads to all sorts of problems if not fixed early on. A player who develops his game while standing too close is often jammed, which leads to short, jerky strokes that are rushed. Players like this may learn to block well, but the shorter, rushed strokes lead to a loss of both power and (when trying to hit harder) control. They also tend to stand in a backhand position, leading to a weak forehand. They also have trouble covering the wide forehand as they are unable to use the full forehand "pocket" since they are jammed at the table - instead, they can only hit the ball in the front of the hitting zone, rather than turn sideways and hit the ball at the top of the bounce with a more comfortable shot that uses the full forehand hitting zone.
As players become more advanced, the opposite tendency comes up - players who back off the table if the opponent so much as looks at them funny. There are times when you should back up, primarily when the opponent is attacking strongly or if you have a defensive style (backspin or topspin), but the backing up should be in reaction to this attack, not as a habitual way to keep the ball in play in moderately fast rallies. With good technique and practice, you should be able to rally pretty fast without backing off too much. If you back off too easily, you give your opponent more time to react to your shot and get his best shot into play; you have no angles to play against your opponent; and you have far more ground to cover, both side to side and in and out.
There is also the phenomenon I call "The Zigzag," of which I'm often guilty. This is where a player takes a step back to cover the forehand, then another step back to cover the backhand, then another step back to cover the forehand, and next thing you know they are lobbing from the vender booths. Instead, learn to play these shots relatively close to the table, but not so close that you are jammed.
So just how far should you stand? A good guideline is to start the rally about arm's length from the table. From that distance you can handle most shots - stepping in for short ones, holding your ground in most rallies, and stepping back when forced to by the opponent's attack. If you are a fast reaction player with good blocking and other close-to-table shots, then try to stay within that arm's length of the table until absolutely forced back. If you are a looper, you'll want to start at arm's length, but as soon as you get into a rally you can take a step back to give yourself more time to loop. (If the rally really gets fast, you'll back up even more, as top players often do when they counterloop.) Some players like to play a consistent off-table topspin game, in which case you'll back more quickly than most players - but try to back up only as far as you really have to as you happily topspin away, and fish and lob only when the opponent forces you to. (In other words, make them go for risky attack shots, where you'll get some free points, before you fish and lob.)
Of course, if you are a chopper, then you'll be backing up as soon as the opponent attacks - though even there, you don't want to back up more than necessary or you'll give the opponent extra time and extreme angles to go for.
Lastly, let me urge all players to at least experiment outside their comfort zone. If you are a blocker, try backing off sometimes - either on defense or looping. If you are an off-table player, try playing at the table as a variation, blocking or even looping quick off the bounce. You may find a new dimension for your game, and at the very least, you'll better understand how other players play, making it that much easier tactically when you play that type of style.