There are three die types:
328
328P
328PB
all have different signature bytes which may or may not impact loading code into them. Generally tho the programming software needs to know which part type is being used, at a minimum for installing bootloader code. Serial downloading may end up ignoring the signature bytes of a bootloaded part.
They can be had in different packaging, this is what Digikey is showing as available options:
-PU - 28 pin DIP
-AU - 32 pin TQFP
-AN - 32 pin TQFP
-MM - 28 pin leadless package, smaller than 32 pin leadless
-MN - 32 pin leadless package
-MU - 32 pin leadless package
-15AZ - 32 pin TQFP, rated for a higher temperature range
-15MZ - 32 pin leadless package rated for a higher temperature range
Any letters to the right of those seen when ordering indicate the method they are supplied - loose parts, parts in a reel, parts in a tube, etc.
Anything else is either an older part that did not follow the convention, or is a counterfeit part.
Tables 38.7 and 38.8 lists these options for the 328 and 328P for example, with H indicating a type of lead finish, and R indicating Tape & Reel availability:
http://ww1.microchip.com/downloads/en/DeviceDoc/ATmega48A-PA-88A-PA-168A-PA-328-P-DS-DS40002061A.pdf
ATmega328-AU
ATmega328-AUR
ATmega328-MMH
ATmega328-MMHR
ATmega328-MU
ATmega328-MUR
ATmega328-PU
And 328P options:
ATmega328-AU
ATmega328-AUR
ATmega328-MMH
ATmega328-MMHR
ATmega328-MU
ATmega328-MUR
ATmega328-PU
With these rated to 105C
ATmega328P-AN
ATmega328P-ANR
ATmega328P-MN
ATmega328P-MNR
ATmega328P-PN
I think you need to pull up the Automotive data sheet to see the Z numbered parts.
And the PB is a different data sheet as well.