It's an idiom used by particular groups of English speakers (Southern Americans, Brooklynites, for example) in colloquial speech. It means, those are the rules. If you see it in printed form, it will likely be in dialogue spoken by a person who uses a distinct dialect. Here are some examples of its use over the years. You'll see that each example contains a heavy dose of other dialectical pronunciations and informal ungrammatical constructions.
From a magazine called Old Guard, published in the 1860s in New York City:
"If the tin's here empty when I comes back, I takes it away. If the wittals is here, why I takes them away. Them's the rules."
From a literary magazine called The Writer published in 1927:
Wot you a-doin' of? Writin' up yer diry? Eat an' walk--them's the rules 'ere. They's others writin'."
From a book called From the Brooklyn Side published in 2000:
"Them's the rules, Dominick. We either live by 'em or we die by 'em. But we ain't gonna break 'em for nobody."
Occasionally, the expression will be used in a jokey manner, as @Barrie England points out, by someone who speaks proper English to express the irony of the rules. As if those rules have been created by an uneducated person who would say "them's the rules" and not "those are the rules."
For example, in this passage from a book called Resurrection Day published in 2000:
"Not my problem. Them's the rules, and that's why I'm about to pull the pin and get out of this rotten city on full pension."
Because it is an ungrammatical idiom, it is best used either humorously or ironically unless it is in the written dialogue of a character who speaks in that dialect, and then it can be used literally (meaning those are the rules) and to your heart's content.