If you came to the United States with the status of being a Temporary Non-Immigrant, but now wish to alter the purpose of your stay – perhaps you came as a tourist but have decided you would rather like to study here – then you can legally change your status simply by filling out the correct forms prior to the expiry of your current visa.
As with other petitions for US visas, an application has to be filled out in order to be able to change your status. It is recommended by the United States Citizenship and Immigration Services that the application is filed the moment that you decide you want to alter your non-immigrant status, and it absolutely has to be filed prior to the expiration of your current visa.
The form that has to be filed is known as the Application to Extend/Change Non-Immigrant Status, also referred to simply as the I-539, and the application can be found on the internet. Your activity in the US cannot be changed until after the application has been approved by the United States Citizenship and Immigration Services. You can change your status providing that you entered the country lawfully on a still valid non-immigrant visa.
You also need to have met and continued to maintain the conditions of that visa and have committed no crimes while in the United States. You will be ineligible for a visa change if you fail to meet any of those requirements.