Facebook

I dont think you can just log out you have to remove the account which will remove all your facebook contacts and everything facebook from your phone. Settings/Email + Accounts/ Tap and hold on Facebook chose delete.
 
Incase it's facebook chat you mean, you can alter the online status. (Online, Busy Appear Offline etc) (Set Chat Status)

But i guess you really mean sign out alltogether which as Big D5 says is a bit of a palaver with the inbuilt facebook integration.

If you stick with the Facebook app only, you can of course log out of that.
 
You can turn Facebook Chat on/off in Settings>Applications>Messaging.

Sent from my HTC Surround using Board Express