Hi, I am a F-1 student, started from last JULY I start to trade stock, the stock value have gone up and I haven't cash out yet ,do I need to pay tax ? what if cash out?

I am graduated 2020 DEC and I am planning to go back to China, would I still be able to trade US stocks ? thanks