How to say "until when do you stay here?" correctly?
Better ideas of what you want to convey include:


待到什么时候 - when will (you) stay till
待几天 - stay for how long
待多少天 - stay for how long


A couple of notes:


几 - is only a number 0-9, not above ten.
几天 - is then thusly less than ten days, technically. Also, this doesn't work like 几号？ if you want to ask which or what day it would be 哪一天？.


Only use this if you know that you've got your numbers right.


多少 - on the other hand contains most all numbers, it's a safer bet.


Your sentence (那你到几天在这边吗？) is missing a verb, specifically 待 -or- 呆 - the "stay" you wanted to translate from your English sentence. 待到 would be better - here 到 indicates completion of 待.


places usually come near the beginning of sentences - 在这边 should come after 你.


Also another more direct way to ask:


什么时候走？