The study, conducted by University of Michigan researchers, analysed responses from 19,775 people who shared about their purpose in life, level of loneliness, quality of friendships and religious beliefs.
Researchers found that lonely religious people tend to see God as a friend, which eases the negative effects of a lack of human relationships.
Todd Chan, lead author of the study, said: "For the socially disconnected, God may serve as a substitutive relationship that compensates for some of the purpose that human relationships would normally provide.
"In other words, people mostly benefit from leveraging religion and turning to God as a friend only when they lack supportive social connections."
The report, which appeared in the Journal of Personality, associates belonging with a sense of purpose. It asserts that the less someone feels like they belong, the less sense of purpose the person will have.
However, the report found that that for people who are not lonely, feeling connected to God as a friend doesn't impact levels of purpose.
Co-author of the study Oscar Ybarra said: "These results certainly do not suggest that people can or should rely on God over people for purpose.
"Quality human connections still remain a primary and enduring source of purpose in life."
Stay up to date with the latest news stories from a Christian perspective. Sign up to our daily newsletter and receive more stories like this straight to your inbox every morning.