Yes, he does have a rule about not killing people, and although he initially did kill some of his adversaries, as previous answers have mentioned, that didn't last very long. Within a year of the character being introduced, the writers decided that they needed a sidekick to whom Batman could talk; and so Robin was born.
Batman Stops Killing - 1940:
A new solo comic book series was then introduced to provide a venue for Batman to operate on his own. The first issue of the new series was a landmark in Batman lore, as it was the first appearance of the villains who would become his best known adversaries: Joker and Catwoman. At this point, Batman still carried guns, and in the same issue, he shot a few monsters to death. This incident, combined with the newly introduced underage sidekick Robin, inspired editor Whitney Ellsworth to issue a proclamation that Batman should never kill, or carry firearms, again. This issue was released in 1940, within a year of Batman's first appearance.
The Comic Book Code Authority - 1954:
Although some of the previous answers have suggested that the creation of the Comic Code Authority in 1954 had some relation to the decision to forbid Batman from killing people, this isn't really accurate for a couple of reasons. First off, he had already stopped killing people 14 years before the CCA was created. Second, and perhaps surprisingly, the Code didn't expressly forbid killing in comic books.
The code was more concerned with promoting civic virtue and moral responsibility, and was aimed at preventing the moral degeneration of America's youth. Superhero comics were a secondary concern, and the Code was primarily intended to curb the incredible popularity of horror, crime, and monster comics. Violence was not forbidden outright, merely gore and excessive violence.
Some examples of the things specifically prohibited by the 1954 version of the Comic Code:
General Standards Part A
Crimes shall never be presented in such a way as to create sympathy for the criminal, to promote distrust of the forces of law and justice, or to inspire others with a desire to imitate criminals.
No comics shall explicitly present the unique details and methods of a crime.
Policemen, judges, government officials, and respected institutions shall never be presented in such a way as to create disrespect for established authority.
If crime is depicted it shall be as a sordid and unpleasant activity.
Criminals shall not be presented so as to be rendered glamorous or to occupy a position which creates the desire for emulation.
In every instance good shall triumph over evil and the criminal punished for his misdeeds.
Scenes of excessive violence shall be prohibited. Scenes of brutal torture, excessive and unnecessary knife and gun play, physical agony, gory and gruesome crime shall be eliminated.
No unique or unusual methods of concealing weapons shall be shown.
Instances of law enforcement officers dying as a result of a criminal's activities should be discouraged.
The crime of kidnapping shall never be portrayed in any detail, nor shall any profit accrue to the abductor or kidnapper. The criminal or the kidnapper must be punished in every case.
The letter of the word "crime" on a comics magazine shall never be appreciably greater than the other words contained in the title. The word "crime" shall never appear alone on a cover.
Restraint in the use of the word "crime" in titles or sub-titles shall be exercised.
General Standards Part B
No comics magazine shall use the word horror or terror in its title.
All scenes of horror, excessive bloodshed, gory or gruesome crimes, depravity, lust, sadism, masochism shall not be permitted.
All lurid, unsavory, gruesome illustrations shall be eliminated.
Inclusion of stories dealing with evil shall be used or shall be published only where the intent is to illustrate a moral issue and in no case shall evil be presented alluringly nor as to injure the sensibilities of the reader.
Scenes dealing with, or instruments associated with walking dead, torture, vampires and vampirism, ghouls, cannibalism and werewolfism are prohibited.
The examples given above are the only ones relevant to this discussion. The remainder of the Code's provisions relate to issues then considered to be vital to the moral health of young people. Some of the provisions in this vein include the prohibition of: cleavage and nudity, seduction, "sexual perversion", profanity, vulgarity, promotion or light hearted portrayal of divorce, sexual innuendo, mockery of religion, portrayals of racial inequality (one Code enforcer actually tried to prevent the publication of an issue of EC comics, owned by the creator of MAD magazine William Gaines, on the grounds that the protagonist was a black astronaut; when Gaines threatened to reveal his reasons for obstructing the publication of the comic, the enforcer backed off), and so on.
As you can see from the above information, the Code never prohibited the depiction of murder, except in the specific case of law enforcement personnel being killed as a result of criminal activity, and even that was merely "discouraged", not expressly forbidden. Torture and excessive physical abuse and cruelty were banned, but it would appear that a character could kill someone, as long as he did it quickly and without undue suffering. The overall tone of the Code, as shown above, was not so much about what the characters could do as much as it was about what lessons a young reader would be likely to take away from the story. If the reader would come to the conclusion that criminality is something to be avoided; that authority figures should be respected; and that "crime doesn't pay", as the old adage goes, then the comic in question would probably get the seal of approval, both literally and figuratively.
In 1971, the Code was revised, and became much more lax. It was now acceptable to portray criminals as sympathetic characters in some cases, for instance. It was further amended in later years, and the prohibitions were almost entirely erased. By the turn of the century, the CCA had very little authority at all, and had become largely redundant. In 2001, Marvel Comics decided to break away from the CCA, and in 2011, DC Comics did the same. Today, the only comic book labels still subject to the CCA are small, child-oriented labels, and are mostly irrelevant.
Getting back to the specific topic at hand, we must conclude that, since Batman could have continued killing his adversaries without the CCA causing problems, the reason he doesn't kill lies somewhere else. As I said in the first paragraphs of this answer, it was an editor who set the policy of non-lethal force, and he did so long before the CCA came into existence. It was simply decided that he didn't need to kill, and would actually be a more compelling, and more admirable, character if he didn't kill people. This issue has been addressed at length in another question on this site.
Since then, Batman has reinforced this idea on too many occasions to count, although there have also been cases where Batman did kill someone, usually inadvertently and unintentionally. The idea that Batman's reluctance to kill is related to the murder of his parents is a later retcon.
Explicit References to the Rule:
Some instances of this rule being mentioned are provided below.
Here, Jason Todd (the second Robin) has just called Batman out on the subject, demanding to know why he refuses to kill the Joker.
Even Superman has criticized Batman for refusing to kill the Joker, despite the fact that he knows full well that the Joker will escape from Arkham Asylum, kill more innocent people, get locked up again, escape again, kill even more people, and so on, ad infinitum.
Note that in both of the above cases, Batman's argument is the same: If he kills once, he will kill again. He can't start killing because he won't be able to stop.
Here, the Joker himself makes reference to Batman's "no-kill" policy.
And finally, we have this scene, which shows the Batman/Joker relationship in a different light than we usually see it. Batman seems to relate to, and have sympathy for the Joker. He makes a surprisingly emotional plea to the Joker, begging him to try and find a way for the arch rivals to rehabilitate each other, and avoid the seemingly inevitable outcome of their mutually destructive relationship: one or both of them killing the other. These images are taken from the conclusion of Alan Moore's masterpiece, The Killing Joke.
Prior to the exchange we see below, Batman says:
I've been thinking lately. About you... About me. About what's going to happen to us, in the end. We're going to kill each other, aren't we? Perhaps you'll kill me. Perhaps I'll kill you. Perhaps sooner. Perhaps later. I just wanted to know that I'd made a genuine attempt to talk things over and avert that outcome. Just once. Are you listening to me? It's life and death I'm discussing here. Maybe my death... maybe yours. I don't fully understand why ours should be such a fatal relationship, but I don't want your murder on my hands.
The conversation continues here: