It is executed immediately at the market price. Whenever there are sellers or buyers the order is completed. It may be that the taker side is divided into multiple participants, which may have different prices in the fills, giving a different average price to the market price.
It is an order to buy at no more than the specified limit price, or sell at no less than the specified limit price. It may be that these orders are never completed. They can be partially completed and the rest added to the OrderBook.
When a certain stop price is reached, it is sold/bought. In the case of sale the stop price is always above the market price, and in case of purchase the stop price is always below the market price.