Depends upon your interests. And how you handle smog. If it's museums then both offer enough to take up a few hours. From PVG you can hop on the subway line 2 (green) for 7Rmb and be at People's Square in an hour (quick transfer across the platform mid-trip). From there you can get just about anywhere in the city, or just walk over to the Shanghai Museum and City Planning Pavilion, then meander along Nanjing Road, rather west or east toward The Bund. The new China Art Museum (old China pavilion at Expo) is five stops away on line 8 (blue).
From PEK you can also hop the rail service which connects to the subway system, then do the circle and cross city lines to Tieneman (sic) Square. Lots to see here, from the Forbidden City to the new National History Museum, then walk over to Wangfujing Street and check out the big department stores before heading back to the airport.
The subway systems in both cities are easy to navigate, with English signs and most announcements, albeit crowded (so check your bags at the airport). You'll need at least 50Rmb in cash for tickets. Most museums are free and you can use a credit card for any meal you might eat downtown (unless you're doing small street food outlets).
I've done both cities this way on a day transit.