It depends where you are mining. If you mine from a pool which allows you to cash out on demand or once you have reached a certain threshold, it is fine.
If you are using p2pool or a pool which sends payments directly from found blocks (or if you are solomining), then BitStamp might not recognize transactions sent to your address.
This covers the technical aspect.
In addition, I'd add that you should ask Bitstamp directly, since deposits from a pool might violate their ToS. Bitstamp is an exchange, not a wallet. I know you're not allowed to withdraw BTC no somebody else's (e.g., a pool) address, but I'm not sure about deposits.