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
Layout must be set to Grid
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: