You will usually pay as you exit a big city and enter another one. That is the main idea.
You can calculate exactly how much it will cost on the French Motorway Company website (I picked up the english version for you): http://www.autoroutes.fr/index.htm?lang=en, before getting on the road.
There are toll booths when you enter and leave the péage. When you leave, they look at the ticket you got when you got on to see how much to charge you.
The charges (“péage” in French) are collected on site. On the roads subject to fees there are toll stations (“gare de péage”) where you will have to pay. There are two types of stations. In the first situation you have to pay a lump sum for using a given road section. In the second you get a ticket when you enter a section subject to fee. When you leave this section you will have to show your ticket and pay. If you enter your itinerary into the ViaMichelin route planner, you will see how much you will have to pay for your trip.
You can pay by cash or by credit card. There are special lanes for people who want to pay by credit card.
There is also a system called “Télépéage”. For that you will need a subscription. If you have it, you can use special lanes and drive through the toll stations without having to stop. The fees are then billed every month. This system only makes sense if you use these roads frequently.
Credit:stackoverflow.com‘