Nationals of EU countries don’t need a visa for any length of stay in Portugal. Those from Canada, New Zealand, the USA and (by temporary agreement) Australia can stay for up to 90 days in any half-year without a visa. Others, including nationals of South Africa, need a visa unless they’re the spouse or child of an EU citizen.
The general requirements for entry into Portugal also apply to citizens of other signatories of the 1990 Schengen Convention (Austria, Belgium, Denmark, Finland, France, Germany, Greece, Iceland, Italy, Luxembourg, the Netherlands, Norway, Spain and Sweden). A visa issued by one Schengen country is generally valid for travel in all the others, but unless you’re a citizen of the UK, Ireland or a Schengen country, you should check visa regulations with the consulate of each Schengen country you plan to visit. You must apply for any Schengen visa in your country of residence.
To extend a visa or 90-day period of stay after arriving in Portugal, contact the Foreigners’ Registration Service (Serviço de Estrangeiros e Fronteiras; 213 585 545; Rua São Sebastião da Pedreira 15, Lisbon; 9am-3pm Mon-Fri); major tourist towns also have branches. As entry regulations are already liberal, you’ll need convincing proof of employment or financial independence, or a pretty good story, if you want to stay longer.