Can I buy and sell the same stock over and over again?

I remember reading somewhere that after you sell a stock, a certain amount of time has to go by before you can buy shares again. Is this true, and if so, what would happen if I tried it?

You may buy and sell stock over and over. There is a theory of investing called rolling stock and the basic premise is that certain stocks go up and down on a regular basis. In this type of investing you buy when it is low and sell when it is high. And if you are really into it, you sell short when it is high.

There is no prohibition against buying and selling the same stock as often as you want. You are probably thinking about the US tax rules. This is from the Money Tax Handbook (excerpt quoted under fair use):