You can only refund a transaction with SETTLED status.
For most payment methods, transactions can be refunded any time after the transaction has been settled, as long as the associated method is still active.
If the merchant has enough balance, once the refund request is received the refund is processed.
When the funds are sent to the card/wallet used to make the initial payment, the funds might not be visible immediately.
For credit cards, generally the refund should be visible on the CC statement between 7-15 working days.