What is the 门 in 厦门 and 澳门？
A place's name ended with 门 (gate/door) is usually an entry point of a city, providence or region. 

The first part of the name may not even necessary be the providence's name. For example, 鲤鱼门 (Lei Yue Mun) is the east gate of Victoria Harbour in Hong Kong, but it isn't called Victoria Harbour Gate, because  the name Victoria Harbour didn't exist 200 years ago. 

As for why it is called 鲤鱼门 (Lei Yue Mun), no one know for sure. May be it came from the legend of 鯉躍龍門 (A carp that can jump over the top of Dragon Gate Fall would turn into a dragon), maybe it's because the terrain there looked like a 鲤鱼 (carp), or may be it was famous for carp fishing.