Instructions on how Heroku Postgres databases can be exported can be found here.
You must upgrade your free databases before November 28, 2022 to avoid the loss of data. Starting on this date, free databases in personal accounts are queued for deletion. Contact Heroku Support as soon as possible to recover your data before it is actually deleted.
See our blog post and the Removal of Heroku Free Product Plans FAQ for more info related to the ending of free plans.