Liquidity refers to how easy it is to buy and sell shares without seeing a change in price. If, for example, you bought stock ABC at $10 and sold it immediately at $10, then the market for that particular stock would be perfectly liquid. If instead you were unable to sell it at all, the market would be perfectly illiquid. Both of these situations rarely occur, so we generally find the market for a particular stock somewhere in between these two extremes.
The bid-ask spread and volume of a particular stock are closely interlinked and play a significant role in the liquidity. The bid is the highest price investors are willing to pay for a stock, while the ask is the lowest price at which investors are willing to sell a stock. Because these two prices must meet in order for a transaction to occur, consistently large bid-ask spreads imply a low volume for the stock while consistently small bid-ask spreads imply high volume.
For example, a bid of $10 and an ask of $11 for stock ABC is a fairly large spread, meaning the buyer and seller are far apart. No transactions can take place until the buyer and seller agree on price. Should this large bid-ask spread continue, few transactions would occur and volume levels would be low, implying poor liquidity: either the bid or ask price (or both) would have to move for a transaction to take place. On the other hand, a bid of $10 and an ask of $10.05 for stock ABC would imply that the buyer and seller are very close to agreeing on a price. As a result, the transaction is likely to occur sooner and, if these prices continued, the liquidity for stock ABC would be high.
However, liquidity is more of a qualitative measure, meaning there is no one quantity of stock volume that can tell us how liquid an investment is.
(For more on the bid-ask spread, read our article Why the Bid/Ask Spread Is So Important.)