Although there is no law telling you how high your earnest money should be, there are customs & expectations. In Silver Spring, MD and beyond, 1% of the sales price is a good rule of thumb to go by. Keep in mind, however, that a competitive market may call for more. In that case, a higher earnest money deposit can give you the edge. Rounding down a bit can also be acceptable in a slower market, when there is no competition from other buyers that is. What I not suggest doing is to low-ball it. All a $1,000 deposit on a 500K house will communicate to a seller is that you don't really care about the house and may not be very serious about buying and, perhaps, bail when you get the chance. Losing 1K is a lot less painful than losing 5 or 10K after all.
It's important to point out that you are not actually giving the seller your earnest money when the offer is submitted - your cash does not end up in the seller's house, nor the listing agent's pocket, it actually stays in your bank account for the time being. What you do submit is a copy of a check or proof of funds if you intend to wire the money. Only when the seller and you have come to an agreement and the contract has been ratified will you hand over the check (or initiate the bank transfer). Depending on the terms of the contract, your earnest money will either be held in a a non-interest bearing (typically) escrow account by your buyer's broker or the title company (that you choose). In Silver Spring, MD and beyond the check must be collected within 3 days if held by the broker and put into escrow within 7 days.
Back to the original FAQ: will I get my earnest money deposit back if my offer is not accepted?
As long as you are in the offering stage - including negotiations back and forth - your money is still in your bank account. You may have already handed over the check but your buyer's agent/broker is holding on to it. Therefore, should you not come to a mutually acceptable agreement with the seller, you will not make a deposit, and your check will be returned to you or you can shred it - unless of course, you decide to quickly submit an offer on a different home.
Could your deposit be at risk and could you actually lose it? That is a different question and one that I have answered previously.