The amount of XP you will earn for (a series of) flight(s) is based on two criteria. Firstly the booking class of your ticket is important. A seat booked in business class will earn more XP than a seat booked in economy class.
The second criteria is the distance of your flight. A flight from South America to Europe will earn more XP than a flight within Europe. Flying Blue has created four distance XP earning buckets for this. The exception on distance based earning is when your flight is domestic. A flight from New York to Boston wil earn you the same amount of XP as a transcontinental flight from New York to Los Angeles.
In the matrix below you can find the amount of XP you will earn for a flight. First find your booking class on the left and then check the distance of your flight in the top row.
E.G. : The distance flown on a direct KLM flight from Amsterdam to Los Angeles is 5.578 miles, which matches a Long 3 segment. Therefore your flight will earn you 36 XP in business class.