You can feel lonely in any circumstance or at any age, even when being surrounded by people, even when you are in a relationship or even when you have plenty of friends. Loneliness is the soul feeling isolated from meaningful connections, out of place and feeling misunderstood.
Bible doesn't say much about loneliness but we can use these following scriptures to help us deal with these feelings.
Psalm 17:15
"As for me, I will see Your face in righteousness; I shall be satisfied when I awake in Your likeness."
2 Corinthians 4:17
"For our light affliction, which is but for a moment, is working for us a far more exceeding and eternal weight of glory."
Isaiah 49:16
"See, I have inscribed you on the palms of My hands."
Psalm 16:11
"You will show me the path of life; in Your presence is the fullness of joy; at Your right hand are pleasures forevermore."
Matthew 6:33
"But seek first the kingdom of God and His righteousness, and all these things shall be added to you."
Philippians 4:19
"And my God shall supply all your need according to His riches in glory by Christ Jesus."
Joshua 1:5-6
"... as I was with Moses, so I will be with you. I will not leave you nor forsake you. Be strong and of good courage ..."
Matthew 11:28
"Come to Me, all you who labor and are heavy laden, and I will give you rest."
Galatians 6:2
"Bear one another burdens, and so fulfill the law of Christ."
Romans 12:5
"So we, being many, are one body in Christ, and individually members of one another."
1 Corinthians 12:26
"And if one member suffers, all the members suffer with it; or if one member is honored, all the members rejoice with it."