Obviously, what an author makes depends on the author. But let’s start with a first-time author.
For paperback, the author gets an advance of $3000-5000 (roughly – there are outliers). Royalty rates start at 6% of the cover price and increase to 8% if the book sells a set number of copies (rarely reached on a first novel).
For hardcover/trade paper, the advance is in the neighborhood of $8000-$12000; royalty rates are higher – starting at 10% of the cover price and going up (SFWA’s model contract says it goes to 12.5% if the book sells over 5000 copies, and to 15% if the book sells over 7500 copies – but publishers don’t have to offer these terms).
The advance is subtracted from any royalties due, but the author gets to keep the full advance even if the book flops (as long as it was delivered when required by the contract, though publishers hardly ever ask back for the advance even then. In addition, the publisher counts a reserve against returns – money set aside for books that will be returned. This is subtracted from the royalties owed.
Note that even these numbers include a wide variety of ranges. Back in the 80s, Star Trek paperback novels were only paying a 2% royalty rate, with a standard advance. However, the Star Trek name guaranteed far more sales than the author’s, so you could make far more money with 2% than with 6%.
I’m not as familiar with eBook royalties; there is no standard yet and they can range from 15% of the cover price to far higher (though the higher the percent, the less likely you get an advance).
Authors can make a living once they have several books in print; the royalties from the older books plus advances for new ones can pay the bills. If you develop a track record, you can get larger advances, since publishers know your books can sell. Eric Flint, for instance, makes a far bigger advance than a beginning author (though his royalty rate will remain the same.
Another issue is that, even if you have several books in print, you’re only paid twice a year when the royalty statements come out. You need to manage your money carefully.