The 24-year-old put pen to paper on Thursday morning after completing a medical on Wednesday.
Compton started his career as a youngster with Portsmouth before moving on to West Brom. He played under Pools manager Colin Cooper during a loan spell at Bradford, where Cooper was caretaker manager at the time.
He has also had spells at Brighton, Weymouth, Lewes, Falkirk and St Johnstone. He joined Colchester in January, where he made seven appearances in League One.
Compton joined up with his new team-mates for the first time on Thursday as they reported back for pre-season training and becomes Cooper's first signing of the summer.