Portals reduce the time it takes to march to a location. They function as a shortcut to your City. To open a portal, click on any location on the World Map and select the "Open portal" option. You cannot open portals on the territory of any Clan other than your own. You also cannot open portals to other Kingdoms, except during the Clash of Kingdoms. You need to build the Portal Master in order to be able to place portals on the map.
Whenever you start a march, the distance between its destination and your City is calculated dynamically. The march always starts from the closest point to the destination and returns to the nearest point. Since portals act like open gateways to your City, if a portal is closer to the destination than your City is, then any march to that destination will start from the portal instead. The march will also return to the same portal, assuming that it is still open.
A portal can be closed at any time by the player who opened it, even if allied armies are marching back to it. In this case, the marches will be redirected either to the next closest portal that is available or directly to the respective players' Cities, depending on the distance between the marches' current location and the players' Cities.
Similarly, if you teleport your City closer to the march destination than the portal from which the march started, your troops will return directly to your City.
If you place a portal at the destination of an enemy march, the march will engage the portal when it reaches it.