When you buy or sell stock online, you can do this as a market order or as a limit order. (Yes, there are even more sophisticated ways, but for now this will do.)
Market Order: Buy or Sell at the price that the market allows at that moment the order is placed.
Limit Order: Do not buy or sell UNLESS the stock reaches this limit price. Do not pay more or sell for less than this limit.
Honestly, I've bought and sold both ways.