Planetary asteroids will only support up to 3 refineries before they stop getting more bonuses. Neutral gravwells can support 4 refineries working on them, but they tend to be difficult to reach.
Refineries (TEC and Vasari) will boost the resource output of all asteroids in that grav well and all the adjacent grav wells.
To get the best results, find the grav well that is connected to the most resource asteroids possible, and dump 3 refineries there. If you can't find a well connected gravwell, don't even bother.
For some reason, starbases don't get refinery upgrades.