I have read Vishnu Sahasranama Stotram. I have found its author which is Bhishma But I haven't found why he wrote Vishnu sahasranama stotram.
After Kurukshtra war Yudhishthira, the was mentally depleted because of the consiquences of war and the misery of death and suffering that happned because of the war in which he was involved and a prominant character . After war on the other hand Bhishma his grandfather, was lying on his deathbed. Shree Veda Vyasa and Sri Krishna told Yudhishthira, to get the advice of Bhishma on Dharma and on how to live a good life. So that he could rule his kingdom rightousely and to ease his miseries. Yudhishthira asked Bhishma series of questions and Bhishma answered it to Yudhishthira. In one of such a dialogs Yudhishthira asked Bhishma's advice on the way by which all the people can get lasting happiness, peace of mind, and relief from all bondage and sorrow.
Bhishma told these 1000 names of Lord Vishnu to Yudhishthira. as Vishnu Sahasranama.
Sri Vishnu Sahasranama Stotram was told to Yudhishthira , with keeping the aim of welfare of Yudhishthira as well as whole of mankind and all its future generations.
These 1000 names of Lord Vishnu were already known to seers and Rishis. So he didn't wrote it he remembered those 1000 names. And recited before Yudhishthira.
य इदं शृणुयान्नित्यं यश्चापि परिकीर्तयेत् ।
नाशुभं प्राप्नुयात्किञ्चित्सोऽमुत्रेह च मानवः ॥ २॥
वेदान्तगो ब्राह्मणः स्यात्क्षत्रियो विजयी भवेत् ।
वैश्यो धनसमृद्धः स्याच्छूद्रः सुखमवाप्नुयात् ॥ ३॥
वासुदेवाश्रयो मर्त्यो वासुदेवपरायणः ।
सर्वपापविशुद्धात्मा याति ब्रह्म सनातनम् ॥ १०॥
That man who hears the names every day or who recites them every day, never meets with any evil either here or hereafter. If a Brahmana does this he succeeds in mastering the Vedanta; if a Kshatriya does it, he becomes always successful in battle. A Vaisya, by doing it, becomes possessed of affluence, while a Sudra earns great happiness. If one becomes desirous of earning the merit of righteousness, one succeeds in earning it (by hearing or reciting these names). If it is wealth that one desires, one succeeds in earning wealth (by acting in this way). So also the man who wishes for enjoyments of the senses succeeds in enjoying all kinds of pleasures, and the man desirous of offspring acquires offspring (by pursuing this course of conduct). That man who with devotion and perseverance and heart wholly turned towards him, recites these thousand names of Vasudeva every day, after having purified himself, succeeds in acquiring great fame, a position of eminence among his kinsmen, enduring prosperity, and lastly, that which is of the highest benefit to him (viz., emancipation itself). Such a man never meets with fear at any time, and acquires great prowess and energy. Disease never afflicts him; splendour of complexion, strength, beauty, and accomplishments become his. The sick become hale, the afflicted become freed from their afflictions; the affrighted become freed from fear, and he that is plunged in calamity becomes freed from calamity. The man who hymns the praises of that foremost of Beings by reciting His thousand names with devotion succeeds in quickly crossing all difficulties. That mortal who takes refuge in Vasudeva and who becomes devoted to Him, becomes freed of all sins and attains to eternal Brahma.
Conclusion - So the purpose of reciting these 1000 names of Lord Vishnu to Yudhishthira was to guide him and all of mankind through their path of life.To help those who are desirious of material welfare as well as knowledge . To free the mankind from all the difficulties of life and to helpthem to attain Moksha at the end , with his discourses on Anushasana and through devotion of Lord Vishnu.
We can read the importance of Sri Vishnu Sahasranama in detail in Book 13: Part 2 - SECTION CXLIX of Anusasana Parva of Mahabharata.