"You dare use my own spells against me, Potter? It was I who invented them - I, the Half-Blood Prince!"
-- Severus Snape (HBP28)
After Snape kills Dumbledore on top of the Astronomy Tower, he tries to flee with the other Death Eaters but Harry chases him across the grounds, attempting several spells which Snape deflects. One of the Death Eaters uses the Cruciatus Curse on Harry, but Snape orders them to stop. When Harry attempts silently to use the Levicorpus spell to turn Snape upside down, Snape realizes it through Legillimency and thwarts him. Admonishing Harry not to use the same spells that James Potter once used to torment him, Snape admits that he is the Half-Blood Prince, a name he called himself as author of the potion edits in Harry’s Advanced Potion-Making book (HBP28).
This takes place on the same night that Dumbledore and Harry travel to the sea cave where Voldemort had hidden the Horcrux made from Salazar Slytherin's locket (HBP27). The date is deduced from the fact that Scrimgeour waits 30 days to bring Harry, Ron, and Hermione the items which Dumbledore bequeathed them in his will, and he did so on July 31 (DH7).