While using the demo trading mode, all executions need to be performed during market hours. Most instruments can be traded from 9:30 am to 4:00 pm EST. Remember, in the demo feature that some markets may be delayed and this could also impact your demo trades.
With live accounts, you can make executions during market hours, or after hours if you possess available trading permissions. Please contact your broker for more detailed information on permissions and trading hours.