Different versions of PostgreSQL are located in the packages postgresql-9.*.
So you should remove your two packages:
sudo apt-get purge postgresql-9.3 postgresql-9.5
Then you should remove unnecessary config folders:
rm -r /etc/postgresql/9.3/ /etc/postgresql/9.5
And from /var/lib/ folder if you have:
/var/lib/postgresql/*
I hope it will help you.