Does a force have to be maintained during a distance to do work? Suppose I kick a ball horizontally with force $F$ and the distance traveled during impact is $d$. The ball then travels distance $d' = d + 10 \mathrm{m}$ before stopping. 
Is the work done $W = Fd$ or $Fd'$? Is there no work done during the distance $10 \mathrm{m}$ after the ball leaves my foot?
 A: When you apply a force to the ball it is a contact force $F$ ie your foot must be touching the ball for the force to be applied.
So the relevant distance is the distance travelled by the ball when it is contact with your foot which is $d$ and the work done is $Fd$ provided that the contact force is constant.
When the ball loses contact with your foot the contact force no longer exists and so there is no work done by the contact force.
A: Yes, when you kick a soccer ball, all the work is done while your foot is in contact with the ball. You might think that the distance traveled during impact is very small, but it's actually pretty big.
A: The formula
$$W = Fx$$
is valid when $F$ is constant and directed along the line of movement. In your example $F$ may be constant on the distance $d$ but it's not constant on $d'$. So the work done by your foot can be expressed as
$$W = Fd$$
After that in your example there is another force (not originating from your foot) that eventually stops the ball that travels on flat horizontal surface. It's the sum of friction and air drag. Assuming this force is constant (simplification) and denoting its absolute value as $F_2$, we have:
$$ W_2 = - F_2 (d' - d )$$
The minus sign is because now the force acts in opposite direction.
So there is some work done during the distance of $10 m$ after the ball leaves your foot. It's not done by your foot but by environment; and it's negative which means the energy flow is from the ball (into the environment in your case).
If the ball was at rest before you kicked it then the net energy change is zero.
$$0 = W + W_2$$
$$W_2 = - W$$
All the work you did over the ball was undone by environment.

In general case work is defined as an integral:
$$W = \int_{a}^{b} \vec{F}(s) \cdot d\vec{s} $$
This means (among other things) that the fragments of trajectory where the force is zero have no impact on the work done by this force.
