The Bible does not present an explicit teaching on this topic. However, the article What happens to babies when they die? in the eschatology section of this Questions & Answers page presents a good explanation of the indirect evidence found in the Bible.
Some Muslims like to ask if Children who die young go to Heaven because of original sin. If not, then this is unjust. In Islam children supposedly do go to heaven. ... However, I found these hadith:
Sahih Muslim, Book 32, Number 6435:
A child died and I said: There is happiness for this child who is a bird from amongst the birds of Paradise. Thereupon Allah's Apostle (peace_be_upon_him) said: Don't you know that Allah created the Paradise and He created the Hell and He created the dwellers for this (Paradise) and the denizens for this (Hell)?
When Aisha expresses her belief and expectation of happiness for the child that died, Muhammad disagrees and instead states that God has created some people for Hell. Obviously, this includes children, because that is the topic of the conversation.
Malik's Muwatta, Book 16, Number 16.16.53:
The Messenger of Allah, may Allah bless him and grant him peace, said, "Every child is born on the fitrah and it is his parents who make him a Jew or a Christian. Just as a camel is born whole - do you perceive any defect?" They said, "Messenger of Allah, what happens to people who die when they are (very) young?" He said, "Allah knows best what they used to do (or would have done)."
This narration is not as strong as the first one, but again shows that Muhammad did not believe all children would automatically go to heaven. He says, we cannot know.
Hope beyond death: The day that death will die
Answering Islam Home Page