I'm curious how the movie The Right Stuff (1983) got away with a PG rating when there are at least 4 occurrences of the f-word. I'm not certain if there have ever been any hard set and official rules on the use of the f-word by the MPAA but it seems like in general, the f-word will get at least a PG-13 rating with very few, if any, exceptions.
As mentioned by @cde, the short answer is that it received a PG rating because PG-13 did not exist at the time. Reading this answer led me to some more details that I feel are important.
First: The Right Stuff initially received an R rating.
The film was originally rated "R" (Restricted, which means no one under 17 admitted) by the Motion Picture Association of America because of some strong language (the word "fuck" is used 5 times, which meant a near-impossible chance of it receiving anything short of an "R" rating) a scene of implied masturbation and other hard content; but it was given a "PG" rating on appeal (the PG-13 rating did not exist then; it was created the year after this film was released).
Second: Only two movies have ever been rated PG that used the f-word
The Right Stuff (1983) contains five uses of "fuck", and All the President's Men (1976) uses the word seven times. Both portray historical events and were granted PG ratings on release; the PG-13 rating was introduced in 1984. The Right Stuff continues to have a PG rating. The current version of All the President's Men contains 11 uses of "fuck" and is rated R.
So the only other PG movie that has ever received that rating while still using the f-word was "All the President's Men" which received an R rating in its current version because the content was changed (now contains 11 uses of the f-word).
So the answer appears to be that The Right Stuff received a PG rating because of an appeal which was apparently granted because it portrays historical events, and the PG-13 rating did not exist at the time. Most likely, if PG-13 rating had existed at the time, it would have received that instead of PG after the appeal, but that is only my personal opinion.
An obvious followup question as to why the rating has not changed is because the content has not changed and a rating appears to only be changed either due to a change in content or due to an appeal prior to its release.