Who was the ruler (King or Queen) of England when Alan Turing's punishment was carried out? Albert Frederick Arthur George died on February 6, 1952, leaving the throne to his daughter Elizabeth Alexandra Mary Windsor; and I've read many sources saying Turing was castrated in 1952, but I can't find any sources on the day of exaction. Queen Elizabeth pardoned him in 2013, so did she pardon him from a punishment that her father's government inflicted or the one she just inherited?
The straightforward answer to your question is that Turing's 1952 conviction is dated 31 March, and so the treatment he was subjected to began after Elizabeth's accession and ended before her coronation (which did not take place until June 1953).
Since it's not clear from the way that your question is phrased that you're aware of what "castration" actually involved in Turing's case, it is worth adding that his punishment did not involve physical castration. Rather, he was subjected to an ongoing series of medical interventions known as "chemical castration". This involved repeated injections of female hormones, initially given in pill form, but from January 1953 delivered via the monthly injection of an implant into Turing's thigh. This treatment had been developed by an American, CW Dunn, during the 1940s. The result, in Turing's case, was impotency and and development of breasts; the treatment does not seem to have impaired his intellectual capacity, and he continued his research and teaching.
Turing's probation period ended in April 1953 and the treatment he was being subjected to ceased at the same time. He killed himself on 7 June 1954. His biographer Andrew Hodges states that it's difficult, in lieu of a suicide note or any record that Turing discussed his feelings about the treatment with anyone, to ascertain whether he recovered his libido after his treatments ceased, what his state of mind was at the time of his death, or to be certain there was a direct connection between his hormone treatment and his suicide.
Source
Andrew Hodges, Alan Turing: The Enigma (1983)