Go to Settings > Company > Attendances. Set the maximum number of hours allowed for an attendance. Go to Attendances > Manage Attedances > Attendances. Attendance are autoclosed after the hours passed are bigger.