If you want to stay between three and six months in France, you need a « visa de long séjour ».
It's compulsory to hold it to be allowed to apply for a “carte de séjour temporaire” or “carte de séjour compétences et talents".
You also need it if you want to apply for a carte de séjour “visiteur”, “salarié”, “étudiant”, and sometimes for “la carte de séjour vie privée et familiale" especially if you're married to a French citizen.
So, before coming to France, check with the French ambassy or consulate
if you need one (because you might)... And if you need one, you'll have to apply at this ambassy or consulate.
How much does it cost ?
There are many different cases with different prices, from nothing to 100 euros.
See "carte de séjour", "titre de séjour" and préfecture