In the 18th and 19th centuries, extramarital affairs were really only tolerated in royal and high society and only in certain liberal areas of Europe (such as England and France). You also have to remember that in these eras, marriages between royals and aristocrats were not supposed to be love matches. They were business arrangements between families and were meant to secure prosperity for both families; the two people being married were not as of much consequence as the political and monetary results of the marriage. Though these matches often did end in a type of respect or romantic love, you can see why many would not have. This is why both men and women began to break their wedding vows and why it was tolerated; as long as the married couple were producing heirs and had the appearance of a happy marriage, that was all that mattered.
In countries like France, the King would be criticized if he didn't have a sufficiently pretty or highly placed official mistress. He was considered less manly if he wasn't constantly seducing women. From a previous post of mine:
The society was not only tolerant of it, if done in a "respectful" way, but actually looked down on the King if he didn't have a sufficiently prestigious mistress. The mistress of the King had an official title and position in French society; the fact that Marie Antoinette's husband didn't have a mistress was a constant annoyance to the French people to the point that Louis irritably told his advisors that it would never happen and to stop asking him about it.
edit: James II of England was also criticized on his choice of mistresses because they were not conventionally beautiful. His brother, Charles II, joked that James' mistresses were so ugly that they must have been provided as penance by his Catholic confessors. Also, a funny quote from one of his eleven mistresses on their appearance and personalities: "We are none of us handsome, and if we have wit, he has not enough to discover it."
Two go-tos are the book Sex in Middlesex: Popular Mores in a Massachusetts County, 1649-1699 by Roger Thompson and the paper "Premarital Pregnancy in America 1640-1971: An Overview and Interpretation", co-written by Daniel Scott Smith and Michael Hindus. The latter appears in The Journal of Interdisciplinary History, V. 4 (Spring 1975) (537-570).
Thompson finds 66 cases of bridal pregnancy in the covered time period, with 44 of them involving a member of a church family. Thompson's book can be found on Google Books.
More surprising are the conclusions by Smith and Hindus that in the second half of the 18th century (1750-99), the incidence of pregnant brides is around one-third. There's a brief preview available online; the whole paper can be purchased through that site.
If we look outside the sixteenth and seventeenth centuries, the idea of sexual restraint isn't all that common. In England during the Elizabethan era, sex outside of marriage was dangerous because it could result in a bastard son. Since another child, especially a son, required some sort of acknowledgement in the inheritance, sex could have potentially costly results. This may be why we hear of or see more evidence that royalty had extra-marital affairs: they had the finances to support bastard children, and could often afford to keep said children among their own household. [This book] (https://books.google.com/books?id=ggK7oOqOVHIC&printsec=frontcover#v=onepage&q&f=false) has some insight into Elizabethan perspectives on sex, especially from a religious standpoint. Another helpful title might be "The World We Have Lost" by Peter Laslett. For an unmarried woman, having a child would be another mouth to feed, so marrying the father provided the quickest and most ideal solution. Even within families, parents often had to be cautious about consummating their marriage, as too many children-even if legitimate-would once again threaten their financial stability. As I said above, this may be why we hear more about royalty and high-profile people having bastard children or extra-marital affairs. Firstly, royalty could afford to provide for their illegitimate children, and secondly, royalty got much more attention in any case-in order to study the sex lives of the average citizens, the most reliable figures would come from births, as mentioned in /u/The740 's post.
An important thing to keep in mind: publication bias. We know more about royalty because, well, people wrote a lot more about them than they did about the plebs, and people tend to be more interested in reading about the fancy kings and princesses than about peasants. But in your question you're comparing yesteryear's royal antics to today's common folks.
Furthermore today's leaders are under a lot of public scrutiny through the press while the public itself is afforded more privacy, whereas in the past authorities could censor while intruding in people's daily lives.
This is a hard question to answer because sexual norms varied so much according to country, region, class, etc. etc. You might want to check out this interesting account from a 19th century doctor who surveyed 100 marriages and decided that without affairs, the chance of a happy marriage was very low. I think the range of different types of relationships (not to mention the incredibly high amount of syphilis) will impress you.