How long has it been since the injury that caused it?
As long as it's been long enough since the injury so that you won't be reopening any interal injuries by riding, I'd think you'd be fine. That would probably be about two or three days for me.
At least if it's just a bruise. If the bruising is from something like an underlying torn muscle, that's different.
And FWIW, keep it iced and it will heal faster.
Not heat - ICE.