Studying the standard is very important for learning H.264 and MP4 container format. Here are the download links of the free official documents.
H.264 (MPEG-4 Part 10 / MPEG-4 AVC), Advanced Video Coding
It is available on both ITU-T and ISO website. H.264 is in Series H: Audiovisual and multimedia systems in ITU-T while it is in Part 10 of ISO/IEC 14496 (MPEG-4) in ISO. If you need to study the relationship between H.264 and MP4 container, you should also refer to Part 15 (not free).