What's the difference between ATMega1284 and ATMega1284p?
The p stands for picoPower. It uses less power than the normal chip.

Atmel picoPower devices can operate down to 1.62V while still maintaining all functionality, including analog functions. They have short wake-up time, with multiple wake-up sources and multiple sleep modes.


  only thing I saw was a difference in hardware, the Atmega1284-pu have
  the window that allow to clear the memory using UV light.


I don't believe this is correct, although from the link you provided it does look that way. I think that company just uses that picture as a default picture, not an actual picture of the device.

There are a couple other options that Atmel uses when labeling their chips, you can read more about it in my post here. 



The letter before the dash (-) is the Option Designator and means:


P &nbsp; "Picopower" low-power parts 
A &nbsp; Newer Fabrication process, lower voltage, lower power, non-Atmel fabricated parts with possibly more noise on A/D inputs
V &nbsp; Low-voltage, lower clock frequency parts before "A" came along 
and nothing is the default part