Every year this takes place the night before the last day of Sukkos. The day itself is called Hoshana Rabbah or the Grand Hoshana.
It's believed that the general decision as to each one's individual livelihood for the year is rendered at Rosh Hashanah.
However, the last night of Sukkos is the last opportunity to change that verdict. Jewish tradition has a plan of action for that night, honed over the last few thousand years.
We try not to sleep the last night of Sukkos and the time is spent as follows:
The minimum: learn the last book of the Five Books of Moses (Dvorim or Deuteronomy) until midnight (12:55 AM in NYC).
The maximum: After midnight and until sunrise read the book of Psamls and study Kabbalah. Take a dip in the mikvah before sunrise.