Psalm 147: Praise the LORD!
For it is good to sing praises to our God;
for it is pleasant, and a song of praise is fitting.
 The LORD builds up Jerusalem;
he gathers the outcasts of Israel.
 He heals the brokenhearted
and binds up their wounds.
 He determines the number of the stars;
he gives to all of them their names.
 Great is our Lord, and abundant in power;
his understanding is beyond measure.
 The LORD lifts up the humble;
he casts the wicked to the ground.
How literally should we take the Psalms? They are poetry and need to be interpreted as such. Sometimes there is some very poetic language that speaks powerful truth to us that we know is not to be understood according to the literal meaning of the words. When Psalm 33:18 tells us that the eye of the LORD is upon those who fear him we know that it means that God is watching over and caring for His children. It certainly does not mean that He has placed His eyeball on them.
We believe that the Bible literally means what it is literally seeking to tell us. But we will not give literal meaning to words and phrase, such as Psalm 33:18, that would just be ridiculous, and were not intended to be taken with such wooden literalism.
All of that to ask this: is Psalm 147:4 literally true or is it a poetic device to tell us that God knows everything? Has God really named all the stars? Whether He has or not, the truth of the matter is that God made everything and knows everything and if He wanted to name all the stars it certainly is not a problem. We tend to doubt that it is possible simply because the universe is unimaginably huge and the number of stars in it are unknown to anyone. There are billions of galaxies, and billions of stars in each galaxy.
Our God is not a regional deity, either in terms of the peoples of the earth or of the whole created order. This means that The God of the Bible is not just the God of the Jews or of Christians in the Middle east. There is only one God for all the earth. But there is also only one God in the universe and the God of the Bible created everything there is. He is in control of everything there is. There is not a single rogue uncontrolled molecule in all that huge universe. God is not a mere ruler of our solar system. That would make Him a part of something bigger than He is and there is nothing bigger than He is. If the magnitude of the universe is a problem for believing in God then our God is just too small.
Does Psalm 147:3 literally mean that God has named all the billions x billions of stars? It might. And if it does then we have no problem with that. He certainly has the ability and the knowledge to do such a thing. Any less an understanding of God is not worthy of the God He is.
Take that understanding of God and add to it this: Planet earth is a pin prick in the universe and each of us is an infinitesimally small part of that little pin prick. And the God who is greater than all the universe, who holds a universe over 10,000,000,000 light years large, and who has named all the stars, dwells in every person who trusts in this God because He became one of us and died that we might have life. That is literally true and it is simply stunning. Such a God who has done what He has done is worthy of much more worship than we will ever give Him. What a God.