It's a general rule. More than that is very highly frowned upon. I honestly am all for giving my bettas up to 10 gallons of space to themselves, though it is a lot of space taken up for one fish. For 10 gallons, I would stick with what Maisy said, but not go over 5 fish, betta included.
I had mollies with my bettas and it was very hard keeping them clean and healthy. I won't be buying mollies anymore, and definately won't put them with any other species again. In ways, they remind me of goldfish.