How soon after baking can you refrigerate freshly made fruit pies?
EDIT: Although the question title says "fruit pies," the question specifies a "fruit custard pie."  The following answer relates to custard pies and other pies containing fillings with eggs and/or milk.  Actual plain "fruit pies" generally contain enough sugar to prevent rapid spoilage and therefore often do not require refrigeration.  If you do plan to refrigerate a plain fruit pie, there's no significant advantage to getting it into the fridge quickly.



Pies do not have to come down to room temperature before refrigeration.  In fact, most food safety organizations recommend the same general policy for egg-based and dairy-based pies as they do for other foods: don't leave leftovers out for more than 2 hours after cooking.  See, for example, recommendations here:


  Foods which contain eggs and milk, with high moisture content, must be
  kept refrigerated, as bacteria love to grow in these foods. Failing to
  put that pie back into the refrigerator before it has remained on the
  counter for more than 2 hours can make a very merry celebration for
  the bacteria, but not so good for friends and family.


So, 2 hours should be a maximum before refrigeration.

As for recommendations about the appropriate time to let cool at room temperature, see here, for example, which states:


  Cool cream pies at room temperature for only  30 minutes after you
  take them out  of the oven.
  
  After 30 minutes, put them in the refrigerator  to complete the
  cooling and to keep them  cold.


While it says "cream pies" here, the guidelines above in that link imply that such guidelines also relate to custard and pumpkin pies.  (The first link above also says the same thing about pumpkin pies.)

Basically, the only reason to keep a dairy-based or egg-based pie out of the refrigerator after removing from the oven is to allow cooking and setting to continue.  Many custard pies will continue to set a bit while cooling, and putting them in the refrigerator immediately might "shock" them and disrupt this process of solidification.  Changes in humidity levels and condensation might also have unpredictable effects on the pie surface while it is very hot.

(As for concerns about putting hot food in the fridge, see links to food safety organizations on the subject in my answer here.  Basically, you shouldn't put a hot or warm pie near anything that's very perishable in the fridge.  Otherwise, you're safer getting it in the fridge as soon as it has stablized after cooking, which shouldn't take more than 30 minutes or so.)