Orders are executed based on price & quantity matching. In case of a limit order, it might remain totally unexecuted if there are no matching orders.
For example, if you place a sell order for 100 shares @ 100 per share. It might remain totally unexecuted if there are no buy orders for the share for a price of 100 or more. Further, an order can get executed for any quantity less than or equal to the order quantity.