It’s better to stretch in the morning because your body will feel way more refreshed when you wake up. There is nothing wrong with doing it at night either because if you are tense then stretching at night can help you sleep better.
Morning, you can feel yourself, your body as you wake up with all your senses, and complete, with your body. You’re connected with it the rest of the day.
I think that it is a personal preference. I suffer from knee and lower back pain and I also sit most of the day for work. Stretching at night helps me release tension from the day and wake up less stiff in the morning.
It spends on what your goals are. If you're more concerned about a good night's sleep, then before bed. If you want to feel energized in thr am, then morning. If you feel like you need both, then there's your answer!