The club made the announcement on their website on Wednesday, with the centre-back heading to the Chinese Super League side on a free transfer.
A statement from Shanghai SIPG read: "We welcome the arrival of Carvalho and we are convinced that he has both the ability and the experience to strengthen our defence next season.”
He has become Shanghai SIPG's latest signing following the earlier arrivals of Oscar in a deal worth a reported £52m from Chelsea and Uzbekistan international Odil Ahmedov.
Carvalho was part of the Portugal squad that was successful in Euro 2016 last summer - the latest honour won in a trophy-laden career.
He left Stamford Bridge after six years to join Real and lifted the Liga title with Los Blancos during the 2011-12 season before joining Monaco in 2013.
Shanghai SIPG are one of Chinese football's star attractions, having also signed Hulk from Zenit for a then-Asian record £46.1m before smashing that mark when securing Oscar.