If you want to do a long workout session at night then it's recommended to complete your workout before 9 pm or 1-2 hours before you will go to bed. But if you want to do a short workout before bed of 5-10 minutes then you can complete your workout before 11.30 pm. Or 30-60 minutes before you go to sleep.