Were is your problem? There are dozens of possibilies how this could have happened: He could have done it while she was sleeping. Or he could possess a memory altering technology.
And the most simple, and probably correct, solution: Do you remember the time, whe you were still an infant? Rukia was abandoned, when she was a baby, so Urahara probably did it at this time... however, this is off-topic in this thread.
Not to the real topic:
What exactly is the point of this thread? What do you want to know?
Are you asking,
how he got this inner hollow, or are you asking
why?
There shouldn't be a question on the
when: He obviously gained it, during the time in Urahara's pit. He didn't show any sign of a hollow before.
I have a new theory: Up to this time, Ichigo was a normal human with sprit powers, but before throwing him into the pit, Urahara killed him and turned him into a spirit, to become a Shinigami. Now as we know since the first chapter/episode, Ichigo has a huge amount of spirit power, and we also know from Aizen's explanation, that Shinigamis and Hollows are limited in their power.
My guess is, that Ichigo's natural spirit power was too much to fit into a normal Shinigami or Hollow, so his soul searched for a way to fit all its powers into a new vessel, so it created this split personality.