If you wish to use data pruning, EXECUTIONS_DATA_PRUNE being set to true is required. EXECUTIONS_DATA_MAX_AGE has a default age, so you would only need to set this if you want this to occur either more or less often than the default.
EXECUTIONS_DATA_PRUNE_MAX_COUNT is optional. By default, pruning would only happen based on the age, but not based on the count. One can set EXECUTIONS_DATA_PRUNE_MAX_COUNT in addition to the max age, and in this case, n8n would prune whenever either one of these limit is reached.
EXECUTIONS_DATA_SAVE_ON_ERROR does what it says on the tin - if set to all, it will save all execution data should an error occur. Meanwhile, EXECUTIONS_DATA_SAVE_ON_PROGRESS save the progress for each node executed (true) or not (false).