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.