It depends on the level of the character and if you’re referring to a separate battle.net account.
If they’re on a separate battle.net and level 30+, there is a 30 day hold on the name for that battle.net.
If you’re referring to two WoW accounts under the same battle.net, then the name will be available to any wow account under the same battle.net immediately.
Lastly, if the name is on a character under level 30, the name becomes a free-for-all immediately.