The 28-year-old helped the Cobblers win the League Two title this season, having joined from Oxford in February until the end of the campaign.
Rose scored once in his 15 Northampton games and will join Pompey on 1 July.
He is Pompey's first signing of the summer, after they lost in the play-off semi-final to Plymouth.
The former Manchester United trainee told the club website: "There's no hiding the fact that this is the biggest club in this division and there will always be certain expectations.
"But I'm sure that the squad we've got here - and the players who are sure to arrive - are capable of challenging for promotion."
Find all the latest football transfers on our dedicated page.
Midfielder Danny Rose has signed a two-year contract at League Two side Portsmouth after turning down a new Northampton Town deal.