According to a U.S. Army Facebook page:

A coin left on a headstone lets the deceased soldier’s family know that somebody stopped by to pay their respect. Leaving a penny means you visited.

A nickel means that you and the deceased soldier trained at boot camp together. If you served with the soldier, you leave a dime. A quarter is very significant because it means that you were there when that soldier was killed.

So what happens to the coins after Memorial Day? It is collected and the money is used for cemetery maintenance, the cost of burial for soldiers.