How long will it take to refund the amount if the transaction is failed ?

Refunds are generally processed on T+1 basis.