First you will need to backup the existing database:
Guide: Backup & Restorehowever PostgreSQL requires free space on your disc drive when actioning a database backup and the free space required will need to be around the same size as the database being backed up. If you do not have this you will either need to free up the space required or have Windows use another location for temorary files:
How to Move Windows Temporary Folders to Another DriveAfter you have a backup file you can then uninstall PostgreSQL, reinstall it on the other drive and then restore your database backup:
Download PostgreSQLDo not install a major version of PostgreSQL that is lower than the one you are currently using and do not install anything higher than v12.