The computer programs recommended in other answers are good, but if you don't want to be reliant on a computer, there are standalone options.
Some guitar multi-effect pedals include some preset drum patterns. I have a Zoom G1 -- pretty cheap -- which has a bunch of patterns including ones in most time signatures including 5/4 and 7/8, and straight metronome patterns too.
This is a fairly cheap way to go, the drum sounds are pretty good, and you get an effects pedal! - but you won't be able to create your own rhythms, there are no fills or variations, and you can't program in song structures.
I only name Zoom because it's the one I know about. Other brands may well have the same feature.
I mention these because they're cheap, and they make drum sounds. You could buy a second hand Casiotone for pocket money, with 100 preset rhythms. Sure, they may not sound amazing, but since all you're looking for is something with more interest to it than a metronome, it might well meet your needs.
Again, you're unlikely to be able to program your own rhythms or song structures.
There are also "toy" drum machines, for which most of the above still applies.
A real drum machine
There are used models on eBay for $50 or so that sound great, have velocity-sensitive buttons, are fully programmable and also have a broad range of preset rhythms. It's a fairly future-proof option, since it will continue to be useful, and if you ever want to sell it, it's likely to keep its value.