"You bought that monster?"
"He's gorgeous, isn't he?"
-- Ron and Hermione with differing opinions of her new pet (PA4)
She buys him at the Magical Menagerie in Diagon Alley, using the ten galleons her parents gave her for an early birthday present. The witch in the shop said that Crookshanks had been there for ages, that nobody wanted him.
Timeline Notes
The day is given, since it's the day before the Hogwarts Express leaves for the start of the school year. The time is just before lunch:
Harry woke on the last day of the holidays, thinking that he would at least meet Ron and Hermione tomorrow, on the Hogwarts Express. He got up, dressed, went for a last look at the Firebolt, and was just wondering where he'd have lunch, when someone yelled his name and he turned.