The postal code format in Peru was updated in February 2011 to be of the format NNNNN (five digits).
The first three digits of the postal code are the postal zone, which corresponds to a Province. For instance, Postal Zone 010 is for the Chachapoyas province. The remaining two digits identify a geographical part of the province - there is no relation between the last two digits and an administrative boundary.
An online tool to search for postal code can be found here: http://www.codigopostal.gob.pe/pages/invitado/consulta.jsf
The historical list of postal codes from Lima and Callao (pre February 2011) is shown below.