All perfect praise be to Allaah, The Lord of the Worlds. I testify that there is none worthy of worship except Allaah, and that Muhammad is His Slave and Messenger.
Just because the number of Allaah's Messengers was 315 does not necessarily mean that the number of nations who have committed Kufr (disbelief in Allaah) and Shirk (associating partners with Allaah) is also 315, even according to the view that a Messenger is one who was sent with a new Divine Law and commanded to deliver it, that is, one who was sent to people who disobeyed Allaah.
This is evidenced by two facts:
First, some of Allaah's Messengers were sent to the same people, such as Moosa (Moses) and ʻEesa (Jesus), may Allaah exalt their mention. They were sent to the Children of Israel.
Second, Prophet Muhammad, sallallaahu ‘alayhi wa sallam, was sent to all mankind and not to a particular people or nation, and no one can fully account for the number of the peoples who disbelieved in him and denied his message except Allaah The Exalted.
For further benefit, please refer to Fataawa 4046 and 84287.
Allaah Knows best.