If you are required to register, your passport will be endorsed on entry to the UK.
Each police force has a department that deals with foreign nationals, the list below details countries whose nationals are generally required to register:
Afghanistan, Algeria, Argentina, Armenia, Azerbaijan, Bahrain, Belarus, Bolivia, Brazil, China, Colombia, Cuba, Egypt, Georgia, Iran, Iraq, Israel, Jordan, Kazakhstan, Kuwait, Kyrgyztan , Lebanon, Libya, Moldova, Morocco, North Korea, Oman, Palestine, Peru, Qatar, Russia, Saudi Arabia, Sudan, Syria, Tajikistan, Tunisia, Turkey, Turkmenistan, United Arab Emirates, Ukraine, Uzbekistan, Yemen.
This list is not exhaustive and any foreign national can be required to register with the police if it is considered necessary by the relevant authorities.
There are some circumstances where you don't need to register with the police, such as if you have permission to live permanently in the UK or have permission to stay as a seasonal agricultural worker for example. There are other exemptions so it is best to check if you are unsure. You can do this by checking on the government website in the related links to this question.