In Factorio, when I surround a Pumpjack with Speed Module Beacons, should I insert Productivity Modules or Speed Modules into the Pumpjacks in order to get the most Crude Oil per second?
Productivity modules and beacons at first is best if you can produce sufficient oil with the pumpjacks you have. (If you can't meet demand, may want production modules + speed beacons) The amount of production it has before reaching its lowest point is limited - so you want productivity to make the most of it before it is gone.
However, once it reaches its lowest production (20% production of initial yield, or 2 oil per second, whichever is higher), you want to switch to all speed to maximize output. The oil is unlimited at this point, so productivity has no benefit over speed which will get you greater output.
Technically, due to how module effects stack, if you use 11 or 12 beacons per pumpjack, it would actually be slightly faster to add a single Prod3 than to fill all slots with Speed3.
However, that is assuming no "Mining productivity" research was done. With just 2 levels of it, even at 12 beacons using all speed is faster than adding any productivity. And you probably researched that much if you use 11+ beacons.
The formula for "crafts per second" is
B*(1+0.1*R+0.1*P)*(1-0.15*P+0.5*S), where B is the base speed without bonuses, P is Prod3 count, S is Speed3 count, and R is Mining prod research level for miners and pumpjacks and zero for normal crafting. The first part is total productivity bonus, and the second is total speed bonus.
Changes made in Factorio 0.16 caused the previous suggestions to be obsolete. Someone at r/factorio made a calculation.
To quote their findings:
In older versions of the game  depleted oil wells produced 0.1 oils/s not 10% of the starting yield. Now all liquids multiplied by 10 so it would be 1 oil/s. The depleted wells were also buffed to 20% of the starting yield or 2 oil/s whichever is higher. So if the wells that start at 10 or 9.1 or 8.3 oil/s all drop to 2 oil/s. If the fresh well produces 11 oil/s it would drop to 2.2 oil/s.
It was somewhat profitable to use production module in a fresh well because the yield used to drop that low.
Now speed module is always better because the well never drops lower than 20% of it's starting production.
 I'm assuming before 0.16
I don’t get this is speed better on depleted but production modules better on full?
Speed is better. Always. Yes, speed modules are better on new (full) wells too.