Pecsi, 20, is a Hungary Under-21 international and was a nominee for the 2025 Golden Boy award.
He made 30 appearances for Puskas last season as they finished second in the Hungarian top flight.
His arrival at Anfield follows the departure of the Reds' former number two Caoimhin Kelleher, who signed for Brentford earlier this month.
Valencia keeper Giorgi Mamardashvili joins the club in July to compete for the number one shirt with established first choice Alisson Becker.