The recommended time to fast before a prolactin test is 10 to 12 hours.