Only if you book the traditional Bedouin cave stays. Otherwise, you’re not allowed to stay in Petra unaccompanied outside of regular work hours.