MP4 is the container (or "wrapper" to use the technical jargon). MKV and AVI are two more examples of containers/wrappers. MPEG-1/2 are both video formats and its own container/wrapper. Quicktime is an example of a container that also has a format of the same name.
MP4 can contain several types of video, and the H.264 format is one of them. XviD and DivX can also be stored inside MP4 files, as those are also MPEG-4 files. MP4 is short for MPEG-4, which has higher compression than MPEG-1/2. H.264 is known technically as MPEG-4 Part 10. Furthermore, AVC is a specific spec of H.264. All AVC is H.264, but not all H.264 is AVC. (Similar to how all DVD-Video is MPEG, but not all MPEG is DVD.)
I keep reading about H.265 in certain industry magazines. It's still in early stages, years away. It's MPEG-H Part 2.
AAC is the "advanced audio codec" (simple name!), and is an audio format. It's also stored (multiplexed, or muxed into) the MP4 wrapper with the video asset.
A "codec" is the compression/decompression algorithm used to encode/decode video or audio files.
When doing any kind of video work, you have to pay attention to all of these. Furthermore, you have to pay attention to settings within each format, including resolution, frame rate (fps), and bit-rate.
MP4 is a common "format" of video (technically accurate: container/wrapper), and H.264 and AAC are inferred by it. Though again noting not all MP4 is H.264. Nor is all H.264 in an MP4. MP4 H.264 is how Youtube transmits video these days, along with WebM, and On2 VP6 (in FLV wrapper). It's very common. H.264 is how most video is now broadcast, including HDTV, though broadcasting is wrapper-less (raw streams are decoded by the receiving device's tuner). Hulu sends H.264 both wrapper-less and inside FLV containers.
Digital video is a fairly complex topic to take in, but it does start to make more sense over time.
Just keeping asking questions until you do.