Generally speaking, creatures can choose to stop possessing a character at any point on their turn as a 0SA. However, this action can be vetoed by another possessing creature or the possessed character, thus trapping the creature. A creature whose escape attempt has been vetoed takes a morale penalty.
Possessions can also be ended forcibly, such as with an Exorcism (see the Faith skill).