This might seem like a very simple question to answer, but actually it is a question which has no definitive answer!
According to the CIA World Factbook, Mexico has 9,330 kilometers of coastline.
According to Mexico’s National Statistics Institute (INEGI), it has 11,122 kilometers of coastline, and that figure apparently excludes the coastlines of Mexico’s various islands.
Amazingly, it is perfectly possible that both figures are ‘correct’.
This is because the length of a coastline depends in large part on the scale of the map used to make the measurements. All maps are generalization of reality, and some are more generalized than others. Small-scale maps of Mexico fail to show every bay and headland; measurements made on them will invariably be under the true value. The larger the scale of the map, the closer the measurement will be to ‘reality’, because the map will show more indentations or tiny crenulations.
Theoretically (mathematically), is is impossible to ever arrive at a definitive length for a coastline since the harder you look (the larger the scale of the map), the more you see, and this carries on indefinitely. This is why it is not at all surprising that different sources offer different distances for the length of Mexico’s coastline (or for particular rivers).
And the moral of this story? In geography, never assume that an apparently simple question has a simple answer!