First of all, you need to download Telegram on your computer and sign-in to the app using your phone number. Once done, go to Settings > Export Telegram data and select the data you want to export. Then, click Export > Show my data.
You can now browse your Telegram data directly from the exported files. If you want to add new messages after the export, you will need to repeat the above steps.
For WhatsApp the steps are different. Open the app on your phone and go to the chat you want to export. Select the 3 vertical dots > More > Export chat. You can export the media as well. Now, send the export via email in order to retrieve it on your computer.
You will need to do this for each chat you want to export, and unfortunately, it will be necessary to repeat the process each time you need to export new data.