If I prepare a mixture for pumpkin pie or sweet potato pie, which has eggs in it, how long is it safe to stay refrigerated before I pour it in a pie shell and bake it?
Still Tasty gives raw eggs out of the shell 2-4 days. Since they rely on the USDA and other (conservative) sources, I'd go with 4 days for reasonable quality, perhaps a bit longer (assess your own risk) for safety. I can't really predict how it would affect quality, but you could certainly try freezing it if you wanted to try to keep it longer. As with all frozen foods that were safe when frozen, the filling would remain safe indefinitely if kept frozen at 0F or lower.
Incidentally, King Arthur Flour has a very highly rated recipe for pumpkin pie, and they specifically recommend making the filling in advance and keeping it refrigerated to give the spice flavors a chance to blend. Put plastic film directly on the surface to keep an unpleasant film from developing.