Hi Mouda,
There is no OOTB settings to auto-close activities. We can do some customizations such as workflow to achieve it.
Workflow is not available for Actibity entity, but is available for specific activity type entities, like Email, Appointment, Phone Call.
Here take Appointment as an example.
1. Go to Advacned Settings > Processes, new a workflow of Email.

2. Select Start When as trigger, if you would close the activity when some fields change, select Record fields change, and click select button to select fields that trigger the workflow if they are changed.

3. Add step "Check Condition", set the condition that the activity will be closed.

4. Add step "Change Status", select the closed status.

5. Save and activate the workflow.
For any other activity type, you can follow steps to achieve same results.