The damage that is given through Spikes is determined by the amount of layers that you place:
However, on top of this, it is possible for the opponent to dispell the Spikes if the opponent uses the move Rapid Spin
Pokémon That Learn Spikes By Level Up