This article cover the basic information that you need to know about visa and working permits in Brazil.
Foreigners that have a tourist visa have right to stay in Brazil for 90 days upon arrival. Should you need to stay in Brazil for a longer period, you can request at your nearest Federal Police office (Polícia Federal) an extension for you visa, which can be for up to 180 days. After this period, visitors must leave the country and can return after 6 months. In order to be accepted, the request for the extension must be filed 30 days before the visa expires.
Visitors under a tourist visa are not allowed to work in Brazil.
Work permits and temporary/permanent visas
Temporary visas are granted to students or professionals that intend to stay in Brazil for longer periods of time. Professionals that intend to move to Brazil must firstly apply at the Ministry of Labour for a work permit. If the work permit is granted, the Ministry of Labour will forward the permit to the Foreign Relation Ministry, that is in charge to contact the Brazilian Embassy that will finally grant the visa to the worker.
Different visas give you the rights to stay for different periods of time in the country. Foreigners with temporary or permanent visas are obligated to get be registered at the Ministry of Justice to obtain a RNE.
A complete guide for work permits can be found at the Ministry of Labour website.