The two events that are usually used by historians to signify the end of the British Empire are the Independence of India in 1947 or the end of British rule in Hong Kong in 1997. Neither are entirely satisfactory answers to the question though.
After the Second World War it became clear that Britain could not retain large parts of the empire. Recovery meant that maintaining the empire was unfeasible. Many parts of the empire had active independence movements. India gained independence in 1947 and was partitioned, creating Pakistan and East Pakistan (Bangladesh). This formally ended the title of Emperor / Empress for the British crown.
However India’s independence was not the end of British dominance of a large number of countries. Many were still run by British Governors and retained the British monarchy. Many of these colonies gained independence in the 1950’s and 1960’s. The symbolic act of handing control of Hong Kong back to China in 1997 is seen as the last act of Colonialism by some.
One gauge of the ‘end’ of empire is the formation of the Commonwealth of Nations. This was formalised by the London Declaration of 1949. It gave membership to countries like India that had gained independence but wanted to retain links with Britain. Each member state has the British monarch as Head of State. However, most are free to manage their affairs themselves.