If you intend on staying more than 72 hours in Shanghai (or Beijing), you will be required to have a valid Visa for entry into China. For most of us, making the 10+ hour flight over the pond, you'll likely stay much more than that, unless you're just passing through the country and onto a different one, in which case you'll need a tourist type of visa. As you can imagine, different countries have a different set of rules, so check your country's visa requirements for China entry.
In the case for US-based travelers, I can tell you that the process that's at least 2 weeks from the time you submit all required documents. The type of visa you need is an "L" tourist visa. For past 5 or so years now, US Passport holders may apply for a 10-year visa for the same price of a 1-year visa! It's totally worth it for obvious reasons.
For a little more information on China visa's for US Passport holders, hit this link on our website: https://www.intrepidphotosojourns.com/china-visa-info