Symbolism, Imagery, Allegory
So, we know that there is a lot of criminality in our novel (check out the "Themes: Criminality" section), and wherever there are crimes, there are criminals; and wherever there are criminals, there are jails; and wherever there are jails, there are locks. Wherever there are locks, there are keys.
We get a tour of Newgate prison in London and we see where the prisoners are kept. Immediately following this encounter, Estella arrives in town and Pip wonders at the sharp contrast she forms against the base world of the jail. But we kind of think of Estella as a prison guard herself, or at least a gatekeeper. Remember when Pip was little and Estella would always let him in and out of Miss Havisham’s front gate? She kept the keys then too. As they grow up, Estella keeps the keys to her heart (though she would argue she didn’t have such a thing) from everyone.
Locks and keys make us think of things that are secret and hidden as well as things that are inaccessible. And what luck—we are exposed to a ton of mysteries in this novel and "high society" (as Pip perceives it) is wholly inaccessible to him. Locks and keys emphasize both social immobility (check out "Themes: Society and Class") and the secrets that lie at the heart of this novel.