Royalties are paid based on a percentage per copy of your book sold. You will have additional royalties paid only if you sell enough books to cover your advance if you receive one. So an advance of $5000 on a book that gives a royalty of $0.50 per copy would require you to sell 10,000 copies to cover the advance and then you would start to receive your $0.50 per sale going forward. Payment schedules can vary but it is typical that authors are paid their royalties every 6 months.