How can I block a telephone number?

We get so many unwanted calls; how can I block that number?  Do I do it while I have them on the line, or after I have hung up?