From your accounts page on Polkadot-JS click on the icon on the very right to open your account on the Subscan block explorer. (Alternatively you can also enter your DOT address directly on Subscan)

Once on Subscan, click on the Transfers tab and then on View All.

Next, scroll to the bottom of the page and click on the Download CSV File button. 

How to export your staking rewards

Your staking rewards will not automatically be included in the output file. You can, however, export them in exactly the same way by clicking on the tab "Rewards&Slash".