Anyone with an even half-hearted inclination towards pedantry will need to be aware that cricket does not have rules. It has laws. These are, however, much as outlined by iain above; for the full set (copyright the ICC) the reader is referred to a recent edition of Wisden's cricket almanac.
The laws form the earliest codification of a modern sport, having taken shape in the 1700s, when some degree of uniformity was imposed on what had hitherto been a purely local rural pastime; village teams were given patronage by local landowners whose interest mainly involved betting; the idea of cricket as the archetypical amateur sport in which money played no role was a rather later development. Although there have been some changes over the last couple of centuries - particularly the move from underarm and then roundarm bowling to overarm bowling during the 19th centuries, limitations on legside fielders in the wake of the bodyline controversy in 1932, and various changes to the rules governing where bowlers' feet could land and the technicalities of lbw (which tended to remain contentious for about 50 years) - the modern laws are essentially similar to those under which the eleven men of Hambledon beat the eleven men of All England on Broadhalfpenny Down in the 1780s, or under which Canada beat the USA in the first ever international game in September 1844.