In order to change the retention period you may navigate to Xray > Setting > Index Resources, Configure and specify the number of days you would like to keep Xray data for that repository:

The retention period could be configured for up to 1,000 days.
The retention period could be configured for up to 1,000 days.