It varies of course....
Quite often the beach is not very deep -- perhaps a few metres or less.
On most shores the action of the waves cuts into the slope of the land to make a notch. Above this notch is a steep cliff or bluff. The notch has a fairly level floor, the "wave-cut platform", which is a little below sea level. This platform is made of the underlying rock ("rock" in this sense could include soft clay or sandstone as well as harder rocks).
Sand eroded from the shore elsewhere is washed along the shore, and when it gets to a sheltered bit such as a bay, it builds up on the rock platform to make a beach. Some sand may even blow up onto the land behind the beach to make dunes. Often you can see bits of the underlying rock sticking up through the beach where the sand is thinner.
In stormy weather, the beach tends to get pulled off the shore a little and the beach gets thinner. Thoughtless coast "protection" works can upset the balance and wash the sand away altogether.
All the above of course works with gravel and shingle beaches too -- and I'm just talking about eroding coasts, the commonest kind, where the land is gradually wearing away.
On accreting coasts (where the land is growing) more and more beach can build up to make very large amounts of quite thick deposits. Quite how thick depends upon the depth of the sea at that point. Such coasts tend to be muddy, but some are sand or shingle.