This is a difficult - impossible - question to fully answer. Nevertheless, in the hopes of partially doing so, I have made a table of several recent presidents in the United States and their family background:
Before beginning an analysis of these results, several caveats must be noted. Research for his table relied
heavily entirely on a certain online encyclopedia - because this is a blog post, not a peer-reviewed study. Moreover, much of this data is very subjective and subject to dispute. The difference between a "middle-class" and an "upper-middle class" family background is a bit harder to define than the difference between, say, the number three and four. So is evaluating whether a president is "good" or "bad;" with a president like George H. W. Bush, for instance, "neither good nor bad" is probably a better answer than "good."
The designations of "lower-class," "working-class," and so on were drawn from the jobs of the parents. "Elite" generally means the president's father - and it is always the father, given the way American society is structured - was a President himself, a Governor, a Senator, an executive of a powerful national business, etc.
This table is a cropped version of the full results. For the full table - including all the presidents, which would be too long to put on this post - see here.
With these caveats in mind, there are nevertheless some conclusions that may be drawn from the table. Not all of America's presidents came from rich and wealthy backgrounds; in fact, only four of the fourteen presidents in the table had "elite" backgrounds. President Bill Clinton's stepfather worked as the owner of an automobile dealership; President Ronald Reagan's parents didn't own a house until Mr. Reagan became a famous actor.
On the other hand, coming from a well-off background certainly helps. Fully half of the presidents above had "elite," "upper-class," or "upper-middle class" parents. Interestingly, five of these presidents with well-off backgrounds were Democrats; two (the Bushes) were Republicans. This is fairly ironic given the working-class versus business-class association occupied by the parties.
A president's family background had relatively little to do with whether he was a good president. Of the nine good presidents in the list, five came from well-off backgrounds and four came from poorer backgrounds.
In fact, a regular person's chances of becoming president are higher nowadays than they were in much of the past. For instance, during the Gilded Age - if one takes a look at the full list - seven consecutive presidents (from President Chester Arthur to President Woodrow Wilson) came from "elite" or "upper-class" backgrounds.
There is other interesting information on the full list. Of America's 43 presidents, 24 presidents were "good" presidents, while 17 were "bad." "Good" and "bad" presidents tend to come and go in waves. From President George Washington to President Andrew Jackson, a total of seven consecutive presidents were "good." But then immediately after comes a long list of really "bad" presidents, from President Martin Van Buren to President James A. Garfield. Out of these thirteen presidents, eleven are "bad." To be fair, one of the "good" presidents - President Abraham Lincoln - is commonly considered the greatest president of the United States.
In total, 13 presidents had "elite" backgrounds. This is more than the 10 presidents who had "lower-class" or "working-class" backgrounds. Of those 13 presidents with "elite" backgrounds, 8 were "good" presidents and 5 were "bad." On the other hand, 5 of the ten presidents with "lower-class" or "working-class" backgrounds were "good." Given the small sample size, this is not enough to really say anything conclusive.
One can do the same with political parties. The Democratic Party has elected 13 presidents; nine of these came from "well-off" backgrounds. By contrast, the Republican Party has elected 20 presidents. Of these, only eight came from "well-off" backgrounds. On the other hand, eight of the the 13 Democratic presidents were "good" presidents, while only 10 of the twenty Republican presidents were "good" presidents.
In conclusion, slightly more than half of America's presidents were "good" ones. Democratic presidents, surprisingly, tend to have more elite backgrounds, and Republican presidents more humble ones. But Democratic presidents are also slightly more competent.
And to answer the question posed in the title: No, one does not have to be born rich to become president today - which was not always the case in the past. But being born rich certainly does help.