All the time... but only after getting to Forage skill level 1, as
@Lew Zealand pointed out. Trees aren't guaranteed to drop a seed when you shake them, even after getting to Forage 1 (and are guaranteed
not to drop a seed until you get there), but upon getting that skill level, you actually are guaranteed a seed when using a hoe on a planted tree seed... whether you planted it or whether it was planted by a nearby tree or just random spawning (
before you get the Golden Clock).
Protip: After getting to Forage 1, clear literally all of the pine trees from your property as quickly as you can. (This is assuming that you have already cleared the space you need for the buildings you need and the farming space you need.) Srsly, pine trees are what you want to cut down for all your wood needs early on until there is literally zero pine trees on your property. (There are plenty of pine trees that reseed themselves in the world, and not quite so many oak and maple.) At this point, you stop clearing trees on your farm except to leave yourself space to get around and for the space you need for your aforementioned buildings and crops. This is when you start harvesting wild trees in the Cindersap and the Mountains as much as possible. They all reseed themselves... and then you start planting additional oak and maple in the tillable terrain in the Cindersap, Mountains and/or at the Train Station. Leave them a while and then come back and you've got a lot dense forest to cut down this time which'll get you more wood. Maybe you start planting trees at the Quarry too... but if you're doing the Quarry, you're better off doing that for tapping the trees you plant there (and flooring off the rest of it so it doesn't spawn rocks to block you).