If I show up in Thailand and pick up the 30-day tourist visa upon arrival, do I have to leave the country to apply for the 60-day visa?
Yes, actual visas are only issued outside Thailand:
Also note that the tourism visa is 60 days, although it can be extended once in the country to 90 days.
If you want 90 days off the bat, you need to apply for a non-immigrant visa, and that in turn requires proof of business (sponsored by Thai company), education (study in Thailand) or retirement/marriage to a Thai national. See the aptly named thaivisa.com forums for the latest scoop on what this means in practice.