Pulling the 12V will turn off the CEL if whatever problem made the CEL turn on is gone. If the problem persists, the CEL will persist.
In any case, the code is stored and won't be erased if 12V is dropped. Codes are erased only when a ODB2 scanner tells it to erase the stored codes.
This is different for the IMA system, loose the 12V (or fuse 18 ) and whatever made the IMA light come on is lost forever.