In the meaning of "to work" they seem to be used in speaking or writing, but what is the main difference in usage ? Are there places where one could be used and the other not?
The differences are not easily covered in an answer here, but I will try to sketch them.
The easiest among them might be "wirken". A better translation here would be 'to have an effect', like medicine has an effect on you. Also a method or a treatment can "wirken", or 'work', if it actually has an effect. "Wirken" can also have various other meanings, that are beyond the scope here I hope.
"Laufen" can be translated to 'run', not only in the original meaning, but also figuratively. A computer can 'run', or "laufen".
It gets a bit more complicated when looking at "funktionieren" and "klappen". It is to be noted that "klappen", in the meaning of "to work", is colloquial and never formal. In this meaning "klappen" can always be substituted by "funktionieren", but not the other way around.
A computer or a machine can "funktionieren", opposed to being broken or not working propperly. But it can never "klappen".
"Klappen" is always used like 'work out' in the sense of
Our plan will work out in the end.
Unser Plan wird am Ende klappen.
If you just omit the usage of "klappen" you are better off in the begining.
I hope this helped.