If I decided to stay longer, can I get a visa while I am there?

You just have to leave the country for 72 hours, upon returning to Costa Rica the permit will be renewed automatically for 90 more days.