Toby, these days a maximum of 5 days. If both teams haven't been in and out twice by then, it's a draw.
Longest ever test match I think was something like 20 days...even I'd get bored watching it for that long.
There's also limited overs matches, 'one dayers' (50 overs each), and more recently the introduction of 20-20 cricket (I'm not convinced of the value of that one...the best part of the cricket is that it takes all day, and drinking as a spectator is compulsory...not much fun if the entire game is over in 3 hours...lol).