Traditional 401k taxation for Non residents (international student)

Hello,

I am an international student working in a manufacturing company. Can you explain how the traditional 401k will be taxed when I decide to withdraw? Will it be based on my tax bracket at the time of withdraw (If I get my H1b visa or employment based green card) or my tax bracket now (F1 OPT)?

 

Thanks