There's no single federal beachcombing law — the rule at any given stretch of coast depends entirely on who manages that land, and the three answers this site has documented so far don't agree with each other.
On state-managed public beaches governed by a state beach-access law, personal-use collecting of loose surface material is often allowed within a stated limit. Oregon's Beach Bill (ORS 390.610 et seq., OAR 736-021-0090) is the clearest example: loose agates, jasper, sea glass and shells may be collected up to one gallon per person per day and three gallons per person per calendar year, and driftwood up to one cubic yard a day, as long as nothing is dug out of bedrock or cliffs (see the Oregon Beach Bill guide).
Step onto land managed by the National Park Service, and that allowance shrinks to whatever the park designates. 36 CFR § 2.1(a)(1) prohibits removing any natural object — living or dead — from NPS land, except what a park's superintendent designates under § 2.1(c); Olympic National Park, for example, allows only a handful of empty seashells per person per visit. Ruby Beach and Kalaloch Beach sit inside Olympic National Park a short drive from Oregon's Beach Bill coastline, and the allowance there is a handful of empty seashells per visit — no rocks, glass or driftwood.
State parks add a third pattern, and it can be the least obvious one: Glass Beach in Fort Bragg, California sits inside MacKerricher State Park, where the state's general rockhounding rule (14 CCR § 4611) technically bans removing the sea glass that gave the beach its name — a rule park staff have confirmed applies even though enforcement is close to nonexistent.