The Shulchan Aruch (OC 581) states “it is customary to awaken at ‘ashmoret’, the last third of the night, to recite Selichot and supplications from the beginning of Elul and on until Yom Kippur”. To this the Rama adds a comment, “the custom of Ashkenazik Jews is not as stated but rather to blow the shofar after the morning prayers… and to awaken at ashmoret beginning the Sunday preceding Rosh Hashana. In the event Rosh Hashana occurs on Monday or Tuesday, we begin the Sunday of the preceding week.”. In a sense, the Ashkenazik practice is an extension of the custom mentioned in the Rambam Hilchot Teshuva (ch3 halacha 4) “It is everyone’s custom to awaken at night during these ten days (between Rosh Hashana and Yom Kippur) and pray prayers of supplication and words of awakening until daylight”. The Ashkenazik practice adds at least four days. These four days are, as the Mishna Berura explains, meant to fill in for the four days during the period between Rosh Hashana and Yom Kippur in which we may not fast. Since there is a custom to fast during the Aseret Yemei Teshuva and being that on the two days of Rosh Hashana, Shabbat Teshuva (the Shabbat between Rosh Hashana and Yom Kippur) and on the eve of Yom Kippur we may not fast, four days preceding Rosh Hashana are designated to replace them. In a sense, the recitation of Selichot is a form of beginning the days of awe.
It would seem the Sefardik custom sees the reciting of Slichot as a form of preparation for Rosh Hashana which is practiced in the Month of Elul.
A careful reading of the Shulchan Aruch and in particular the Rambam teaches that slichot are meant to be recited at night. Ideally, they are meant to be recited during the “Ashmoret”, the last third of the night as a preceding prayer to the morning prayers. When that time is not possible then night is the key defining factor of Selichot. Preferably they should be said after midnight so as to avoid Kabalistic issues associated with reciting Tachanun (which is part of the content of Slichot) at night particularly the first half of the night (Shulchan Aruch OC 131 sec. 3, Mishna Berura notes 16, 18-19) Slichot are also ideally recited during the “ashmoret” so they run into the morning prayers and function as a preparation to them.
Both the idea of praying at night and the reciting of a prayer in preparation for the morning and morning prayers in particular seem to have a common purpose. The Slichot are meant to be an awakening to teshuva (repentance). By attaching them to the morning prayers, we are stating that there need be an act of preparation for a more ideal worshipping of God. So too by instituting a special night prayer, we are bringing the worship of Hakadosh Baruch Hu into the night. Night represents a time of doubtfulness and confusion, a time when man’s confidence is at a low. Night is the time we call out to God to guide us. The Slichot are a reminder that when we have sinned we are, in a sense, in a time of night and must call to God to direct and aid us in returning to him.
As we have seen, there is an aspect of night prayer and an element of pre-morning prayer in Slichot. Therefore, there is a halachik debate in the event Slichot cannot be recited in the latter part of the night, whether we should prefer the proximity of Selichot to the morning prayers even though they are recited in the morning. Or, should we recite the Slichot at night even though it does not immediately precede the Morning Prayer.