Hello Davide,
You have no config settings in your code which indicates to me you are using the default config listed in the pbp\18f4620.inc file, which was designed for 4mhz operation, so you have to either change those configs, comment them out and put the correct ones into your code, or change your resonator and define to 4mhz. Look at the links provided by mister_e.