Typically, you need to inform the PG management in advance and settle any outstanding dues before vacating the premises.