However, we know that she began writing the first book, "Harry Potter and the Philosopher's Stone", in 1990. It's likely she came up with the name during this early stage of writing.
While we don't know the precise moment, it's safe to assume she was likely in her home in Edinburgh, Scotland, where she lived at the time.