how long depends on your visa office. you would need to request them to change it for you, and this would require you to have your new passport already. the COPR MUST match your passport. if you already have your new passport, then you won't be able to land with your current COPR, so you would HAVE to wait for the visa office to reissue it.
I was in the same delemma... just as i was about to change my name, i got my PPR. I've been told it's easier to wait until after landing to change everything, so that is what i decided to do. apparently, once your original PR card is issued, you can then apply for a new one with your new name.