The original opening story "An Unearthly Child" doesn't explain why it remains a police box when they leave 1963, it just has a line where they arrive in the prehistoric past and the Doctor says "It's still a police box. Why hasn't it changed? Dear, dear, how very disturbing", and explains to his new human companions that it's supposed to disguise itself in every era. The answer to why it got stuck is finally revealed in the 4th Doctor story "Logopolis", where the Doctor was planning to have the chameleon circuit repaired by the mathematicians on Logopolis. From the transcript here, there was this bit of dialogue about why it was broken in the first place:
ADRIC: So the chameleon circuit's stuck?
ADRIC: In Totter's Yard.
DOCTOR: In a totter's yard. Anyway, it was ages ago. It doesn't
matter. She was in on Gallifrey for repair when I borrowed her.
ADRIC: I thought she was yours?
(The Doctor gets underneath the console.)
DOCTOR: Well, on a sort of finders-keepers basis, yes. I should have
waited till they'd done the chameleon conversion, but there were other
pressing reasons at the time.
So, from this it seems that it was already in need of repair when the Doctor "borrowed" the TARDIS, but perhaps it was able to function for a while before becoming stuck permenantly, since the 1st Doctor and his granddaughter Susan referred to some adventures they'd had prior to Earth in 1963. Also, from the transcript to that first story "An Unearthly Child" here, I see that when they first noticed it had become "stuck" as a police box, Susan said "it's been an Ionic column and a sedan chair."
As Paul D. Waite mentioned, there was also a 6th Doctor story called "Attack of the Cybermen" where the Doctor attempted to fix it and did get the TARDIS to transform itself into other shapes, but it was changing into out-of-place shapes like a pipe organ rather than ones that would blend into the surroundings, so in the end he went back to the police box.
Depending if you want to incorporate comics continuity into your personal headcanon (Doctor Who has no official 'canon'), the Chameleon Circuit article on the Doctor Who wiki mentions an alternate explanation from the comic Hunters of the Burning Stone:
The Eleventh Doctor travelled back in time to 1963 and destroyed the
TARDIS' chameleon circuit so that the TARDIS would always remain a
police box, so that the mental image of the TARDIS would be etched
into human culture and history. (COMIC: Hunters of the Burning Stone)