I had a client who purchased a HUD home and the foreclosure deed was not filed. It took them two weeks to fix this, in Wayne County, Michigan, which is not know for being fast. My client closed on the home right away.
That said, there is no simple answer to this question as it depends on 1) whether or not there is some other underlying problem that has not yet been fixed, 2) how quickly the bank asks their lawyer to do the filing and 3) how quickly the lawyer does the filing.
I had another case that was never resolved and we had to terminate the contract. Best thing you can do is make sure your agent thoroughly investigates the underlying problem and calls the sellers agent every 2 - 3 days until this is resolved.