There are also variant rumors. For some reason, this is often mentioned on Usenet.
Evidence is discussed below, but the short answer is that it's almost certainly true.
The Church of Scientology has actually taken German publishers to court for printing this story. One form of the rumor is that L. Ron Hubbard made a bar bet with Robert A. Heinlein. This is definitely not true. It's uncharacteristic of Heinlein, and there's no supporting evidence. There is, however, inconclusive evidence that Robert Heinlein suggested some parts of the original Dianetics .