The book of Esther provides both the story behind Purim and the biblical basis for its celebration.
Esther 3 describes Haman casting the pur, or lot, to determine the time for carrying out his plan against the Jewish people.
Esther 4 records Mordecai's appeal to Esther and her decision to approach the king despite the danger. Her request that the Jewish community fast for her is an important turning point in the story.
Esther 7 describes Esther exposing Haman's plan before the king. Chapters 8 and 9 describe the reversal that follows and the deliverance of the Jewish people.
Esther 9:20-32 is especially important for understanding Purim. It explains the name of the festival and establishes its continuing observance. Feasting, joy, sending food to one another and giving to the poor all appear in the biblical account.
There is no clear New Testament reference to Purim. Rather than assigning uncertain Gospel passages to the festival, it is better to leave the New Testament Scripture field empty.