You can either apply and obtain an extended visa from a Sri Lankan Embassy/ Consulate from your country of residence prior to arrival in Sri Lanka or get an extension from the Department of Immigration and Emigration in Colombo 10. This procedure will take about 2-3 hours, and you will have to give a bona fide reason for staying over 30 days. If you are staying in a resort for a long period, the staff will be able to help you with the application.