If it has at least one confirmation on the blockchain then you have to wait. If it has no confirmations it can be stuck indefinitely until a miner picks it up or rejects it I guess but in that case there are ways to free the transaction if you look on net.