Officially, the Prime Minister is appointed by the Monarch, but s/he is chosen by the political party who won most constituencies in the general election. The party leader is chosen in general. The Prime Minister is not indeed directly elected by the voters.
The roles of the Prime Minister are numerous. First, s/he plays a predominant role on the world political stage. S/he is also key in domestic matters. The Prime Minister dissolves the Parliament (but the Monarch officially carries out the procedure). In Parliament, the PM attends the Prime Minister’s Question Time (PMQT) once a week in the House of Commons every week during Parliamentary sessions. The PM is the Head of the Government and being so determines governmental policies and strategies. The PM is ultimately responsible for all governmental decisions. The PM is also Head of the Cabinet, chairs and organizes it and is responsible for its agenda. The PM decides the number and organization of the Ministries. Even though the PM is not the Head of the Civil Service, s/he plays a crucial role in its organization and appointments. The PM is automatically the leader of his or her political party.
The powers of the PM are not written or codified by law and derive from customs and conventions. Among the PM’s most crucial powers is to appoint over 100 parliamentary figures such as the 20 or so members of his Cabinet, the Ministers of State, Under-Secretaries and Whips. Most come from the House of Commons and some from the House of Lords. Outside the government, the PM appoints some key jobs such as top Civil Servants (Permanent Secretaries, Deputy Secretaries and heads of security services), top members of the Judiciary and the Armed Forces, bishops of the Church of England, chairs of the Royal Commissions and Committees of Inquiry, the Director General of the BBC, the Chairs of the nationalized industries and of important tribunals and numerous quangos (for ‘quasi non-governmental organisation’). The PM also plays a role in the appointments made by the Monarch, for example knighthoods, peerages and honours.