It could be a transmission problem, that's bad and expensive.
There are other possibilities, like ignition or fuel delivery problems but have it checked immediately by a mechanic that you trust. Best case is you are low on tranny fluid.
If the transmission is bad be careful not to spend more on the repair then the car is worth.