How to stop and save data on arduino board

my accelerometer keeps on collecting data, how can I make it stop collecting after some time?

The accelerometer does not collect data. It outputs data. The Arduino collects it, and sends it to the serial port.

If the Arduino were to stop sending the data to the serial port, which it could do after any amount of time, what should it do, instead? When would you want it to resume sending data, if ever?