Portugal has three international airports on the mainland: Lisbon (LIS), Porto (OPO), and Faro (FAO). Lisbon and Porto handle long-haul traffic from North America and Brazil; Faro mostly serves budget European carriers and summer holiday charters to the Algarve. TAP Air Portugal is the national carrier with direct transatlantic routes from New York, Boston, Miami, Toronto, and several other cities. United and a handful of others also fly direct from the US.
The Azores and Madeira each have their own airports (Ponta Delgada on São Miguel island, and Funchal on Madeira). SATA/Azores Airlines connects both archipelagos to Lisbon and to North America. TAP operates the Lisbon–Funchal route frequently.
There is no direct train from Madrid to Lisbon — a long-discussed link remains unbuilt. The best overland route from Spain is bus: Rede Expressos and FlixBus operate services from Madrid, Seville, and other Spanish cities. If you're driving from Spain, the only land border is with Spain, with multiple crossing points open around the clock on major routes.
From the UK, flights run to all three mainland airports. Overland travel via France and Spain works but is a long haul — most people fly.