"G" was for General audiences, anyone and everyone could see a film rated "G". Few films had this designation, outside of Disney features, as a "G" rating was considered a kiss of death commercially.
"M" meant that the film was for "Mature" audiences. Tickets for these films were also sold to any one who ponied up the admission price at the box office. "M" later became "PG", which stood for "Parental Guidance suggested". When INDIANA JONES AND THE TEMPLE OF DOOM was released with a PG rating, some groups complained that the violence was a bit too intense for younger audience members and the rating "PG-13" came into being.
Films rated "R" required an accompanying adult for viewers under 17, while an "X" rating meant
that absolutely no one under 18 was allowed to see the film (LAST TANGO IN PARIS anyone?) This rating has since been changed to "NC-17" but you rarely see it anymore as it too is considered box-office poison. The makers of some films that contain extreme content (sex and/or violence) release their product without a rating but that's still a dicey proposition.
Keep in mind that under this system, an "X" rating is not the same as a Triple-XXX rating that was and is routinely found on hardcore porn films.
In the history of the Academy Awards, only two films that were originally rated "X" on first release, earned Best Picture of the Year Oscar nominations. One of these films actually won the award. Can you name them?