Go to My Account > Visibility to set your profile visibility.
Note that you cannot make anonymous posts - at minimum, the system will display your name.
Teachers:
Teachers cannot fully hide your presence from the network. At a minimum, your name and group memberships will be displayed in the School Directory and applicable Classroom Directory. If you do not want this, deactivate your account.