You should deactivate your PS4 so it's no longer associated with your account if you are selling or giving it away.
You can choose to appear offline on a PS4 when you first log in, or at any time when you're online. Here's how to do it.