This option is available for the Portal and Shared View extensions.
To enable this option for your extension, do the following:
Go to the Tables section of your portal or shared view
Click on the table
View Type must be set to Grid for the Default View Settings or custom views in the Views section.
In the User Actions section, enable the Download records as CSV toggle:
Once activated, your users will see a download button just above the grid view: