The answer is complicated, in general the time counted for permanent residence depends on the kind of residence permit that you have. If you have a student residence permit, then that time does not count.
The confusion comes that most non-EU students are doing PhDs on student residence permits, but this is not always the case, because other residence ...
No, per the UKVI answer to this freedom of information request. You must leave the U.K. within the expiry date of your existing visa unless you have an outstanding application with UKVI.
There is no point in time at which you absolutely cannot visit the US as a B2 visitor or VWP visitor. However, entering the US as a visitor requires you to convince the officer that you do not intend to immigrate during this stay. Although intent to immigrate in the future does not prevent you from showing you do not intend to immigrate during this stay, it ...
This will cause no problem for periods up to
6 months, as a general rule (§ 51(1)(7) AufenthG)
12 months, for EU Blue Card holders (§ 51 (10) AufenthG)
For any longer period, permission must be granted by the foreigners authority.
Section 51 AufenthG
Termination of lawful residence; continued validity of restrictions
(1) The residence title shall ...