If you are an EU citizen, you can enter Portugal freely and only need to register in the country after three months. If you are from outside the EU, you will likely need a visa to establish residence, with various options available including the Golden Visa, D7 Visa, and others depending on your circumstances.