The legal age of drinking in Portugal is 18 years. The legal alcohol limit for drivers is 0.5 grams per litre of blood, so don’t drive drunk.
It’s not forbidden by law to drink in public places (like beaches) in Portugal, and it’s also more or less socially acceptable and very not frowned upon as long as you behave well and don’t cause any scenes or get into physical fights.