It is being said that in a long-gamma portfolio, you follow a buy-low sell-high strategy for the underlying stock, which causes you to make profit. The Theta for this portfolio is negative. But it is also said that you can lose money, why though?
If you are long gamma, your delta is increasing at an increasing rate. In order to delta hedge this position, you will be selling stock as the stock price goes up and buying stock as the stock price falls.
An explanation of gamma trading can be found in my response to this question: What really is Gamma scalping?
If you are long gamma, you are long realized volatility. In other words, you need the underlying stock to move to make money from the gamma (although you may also be long vega, in which case you will make money if the implied volatility goes up and the stock does not). If the stock does not move, the option position will lose money every day by the theta. The theta is the premium decaying over the life of the option.
There are two ways you can lose money:
The actual volatility of the stock is less than the IV you assumed. For example (extreme case) let's say that the stock price does not move at all: you make no money at all on the gamma scalping and you lose on your theta. The gamma scalping counterbalances the theta only if the stock moves "enough".
The stock price moves suddenly (a jump, which violates the BSM continuous hedging condition). You are unable to adjust your hedge and thus you lose money to "hedging error" .(It is not easy to buy when prices are rocketing up and hard to sell when they are plunging).