It depends. If it fits into the bag I'm using with the lens on it, I leave it on. If not, I take it off.
That will only catch dust just floating about. The protect the sensor, get clear double sided tape and put it right over the sensor itself. Now your sensor is completely protected from dust. And since the tape is clear, you can leave it on while you shoot. Just be careful not to farkle the shutter.