A limit order rests in the order-book until price reaches your level. It guarantees the price but not the fill. If the market never trades at your limit, you simply do not get in or out.
Limits are how you avoid slippage and how you can capture the bid-ask-spread instead of paying it. The cost is that fast moves can leave you behind.
Example: the stock is $20.05. You place a limit buy at $20.00. If it dips to $20.00 and there is enough size ahead of you, you fill; if it bounces at $20.01 and runs, you miss the trade.
Related: market-order, fill, order-book, good-till-cancelled