What are stale shares and what can I do to avoid them? When I mine at a pool, only a part of my shares are accepted. There is a small percentage which is marked as stale.

As far as I know I only get paid for accepted shares, so what are these stale shares and how can I avoid them?
Stale shares are the shares that were sent after a block was already solved, that is to say, they were sent late and were no longer valid. To avoid stale shares, best to have a reasonably fast mining rig (so you won't take too long to calculate a share, probably not a problem for most machines), reliable internet connection (stable, not necessarily fast), but also an up-to-date mining software (if you are mining with some really old miner it might not communicate in the most efficient manner with the pool).

In short - update your miner every now and then, make sure your internet is running okay, and don't mine on really weak rigs.