For live market orders, buy and sell orders are only executed when the market is open.  You can place them at any time, except between 4:00 - 4:15 US Eastern Time. 


Between 4:00pm - 4:15 ET, market orders are rejected and will not sit pending for the next session. 


After 4:15pm ET, or for orders placed on a weekend/market holiday, market orders are accepted for next market open.