The official PostgreSQL apt repo currently has: PostgreSQL 9.2, 9.3, 9.4, 9.5, 9.6, 10, 11devel.
Just follow the official instructions: PostgreSQL: Linux downloads (Ubuntu)
TL;DR:
sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt/ zesty-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
sudo apt-get install wget ca-certificates
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
sudo apt update
sudo apt install postgresql-9.5