In 1881 there would have been a census return taken in the April and the prison would have contained details of his age and place of birth.
The actual process for sending him to prison would have been through pretty much the same Justive system as today, i.e the Magistrates Courts, or the Crown Courts. The records for these are closed for a long while bit the 1881 ones may now be in your local County Record Office. but your best bet is to search the local paper for the town he was living in or at least the town where the main local newspaper was and where the magistrates court was. This would contain a series of reports on the offence, the hearings at the magistrates court and then any referral to the Crwon Court and subsequent sentensing.
You will find the filmed and often indexed copies of the local newspapers in the local reference library for the particular town.