When placing a limit or a stop order, you will have to specify the time in force. This will specify how long will the order stay pending if it does not get executed.
You have two options:
DAY: the order will stay valid for only one day. If it does not get executed within this day, the order will be cancelled.
GTC: which stands for good until canceled. The order will stay pending with no time limit.