You should always have ALL of the payment arrangements made before you write a single word. I highly recommend demanding full payment up front for most work, at least until you’ve developed a relationship with the other person. If it is a large job, accepting half up front, and then half after you have delivered a part of the work is fairly standard as well. Whether you get paid up front, or after you write, however, you need to make sure there is no confusion on the matter.
You should have an agreed upon amount, in writing, before you start the project. I typically charge on a per article basis, so if someone wants 5 articles at around 500 words each, I’ll make sure they are clear on the fact that they will have to pay $125 (on average). If they need images added to the post, they will need to know whether or not that will cost extra. Same thing for other extras like some types of formatting, having me post it to their page and other such things.
Talking to the client about the price up front will save a lot of trouble down the road. When dealing with money, it is always best to have everything completely clear with both parties. Even if you opt to wait for payment until after delivery (which I don’t recommend) you should send the client an invoice before you start, so they can see exactly what they will have to pay. If you don’t know the total amount the work will cost, send them an initial invoice with the minimum amount, and a comment saying that the final price will be determined based on word count (or whatever) is a good idea.
Avoiding conflicts about payment can help keep both you, and your clients happy, so you can work together long into the future.