You can not buy or sell the shares in NSE and BSE during Saturday and Sunday and after 5.00 PM on all weekdays officially. But the brokers take the orders and implement it to buy and sell the next day when stock market opens up. The stock market opens and closes in its time regulated by the SEBi.