First, license law requires that when a Realtor collects a check from a client, that check is to be deposited immediately into the broker's non-interest bearing account. Realtors are NOT permitted to "hold" checks. That is why we use Promissory Notes. If your Realtor does not intend to collect the money yet, he or she will have the client sign a Promissory Note, which is a promise to pay at a future date and describe in the offer the conditions that must be met before the note is collected.
Second, if the seller has signed the offer, regardless of whether the bank has approved it yet, you are under contract with that seller. The property is in "Contingent" status, which means that you have a contract that is contingent upon certain conditions being met, whether that would be bank approval, a satisfactory home inspection, and/or loan approval.
Your contract states that all parties will, in good faith, make every effort to cause all of the conditions to be met to complete the transaction. If you withdraw from the contract without good cause, good cause being that the bank declined the offer, the home inspection failed or the lender declined you for financing, and a good faith deposit had already been collected from you, you do stand the risk of losing your deposit to the seller.
The seller must agree to release you from your contract with them and must agree to return that deposit to you. The seller may release you but make a claim for the earnest money, in which case, you may have to arbitrate to have it determined who will receive that money. If your agent has collected money from you and has not deposited it to the broker's holding account, and the seller declines to return your earnest money deposit, he or she can not only be on the line for that money but has also created a situation that puts his or her license in jeopardy.
I hope this clears up any questions and corrects any misinformation that was stated previously.