As a US passport holder, you will be given a 30 day visa free stay upon arrival. You will need to go through passport control to get it.
Yes, you can leave the airport. The airport offers free tours of Taipei for people like you, but I've never done that. Do a web search for information or look at some past posts in this forum that talk about it. Or you can figure out your own way to get into town. Theoretically there regular bus service between downtown Taipei and the airport, but you may find it difficult to figure out which bus to take. You can pay a taxi (it will cost about $40-45 US) to take you from the airport to downtown. Another possible route is to go by taxi to Taoyuan HSR (High Speed Rail) station from the airport. It will cost you less than $10 US. At Taoyuan HSR station buy a ticket on the HSR to go to Taipei Central Station and take the MRT (metro) wherever you want to go. Follow the reverse to go back to the airport but when you're at Taoyuan HSR station, ask at the help desk where the bus (very cheap) is that goes to the airport. You can take the bus from the airport to Taoyuan HSR station, but it stops only very briefly at the airport to drop people off and you're not real likely to figure out which bus it is. That's why I suggested going by taxi to Taoyuan HSR station. That taxi->HSR method isn't fast and it's not as cheap as the direct bus from the airport, but it is a possibility that is a lot cheaper than paying a taxi to go downtown.
I would recommend that you arrive at the airport 2 hours before departure because the check-in lines can be quite long and time consuming.