M4P format is "protected AAC". It is a format of purchased music that can be listened to only through the iTunes softer or an iPod.
.m4a is the file extension attached to names of files using the MPEG-4 Audio standard. The normal extension for any MPEG-4 file is .mp4, which is also mentioned in the MPEG-4 standard. The .m4a file extension has been popularized by Apple, which started using the .m4a file extension in their iTunes software and iPod music players to distinguish between MPEG-4 Video and Audio files. Currently, most software that supports MPEG-4 Audio also supports the .m4a extension. The most common type of .m4a files available are those using the AAC (Advanced Audio Coding) audio format, but other formats such as Apple Lossless and even mp3 files may be put inside a .m4a container file. You can normally safely rename the file extension of a .mp4 file containing only audio to .m4a or vice versa to get the file to properly play in your favorite audio player.
The audio file format used by Apple in their popular iTunes Music Store often appears on your system with the ".M4A" filename extension. M4A can produce better audio quality than MP3 using less physical space for the files.