I had purposely built a 12 hour connection in PVG to visit friends and sight see. You can take the Maglev/subway combo into the city in under 40 minutes, depending on where you want to go in Shanghai.
Visit the observatory at Shanghai Tower, stroll the Bund, see some other Shanghai attractions for a few hours, eat some good eats.
Lots of options if you plan ahead.