Wherever the costs come from they are almost invariably paid out at the end of the claim when the compensation is paid out, or later.
There is an exception to this if there's an interim costs order. In that event costs can be paid out during the case. Sometimes because of this you can find you have to pay out of your own money even in spite of the fact that it's a no win no fee agreement, and you may or may not have won. These costs are normally payable within 14 days.
This can also apply for example in relation to expenses that need paying to other people during the case rather than to your lawyer.