Presumably you found the name in the prison quarterly returns. You can also look at Licences - where prisoners had completed their 'tariff' - 3/4 of the their sentence, they were released 'on licence'. Licences contain all the information concerning prison earnings, state of health etc. and detail where prisoners were transferred to and when released.
The licences are available at the NA at Kew.
You will find lots of information about Woking Prison on
http://wokingprison.blogspot.co.uk/The blog has had no new posts for some time, but holds a lot of good information about the buildings, the set up and the prisoners. It certainly suggests that the primary purpose of the prison was to hold mental patients - but whether they were ill before entering the 'separate, silent system' or whether they became so because of it, is for you to decide!