The immigration rules allow for applications to be made to enter or remain in the United Kingdom on the basis of relationships where the couple are not married or in a civil partnership. Opposite sex couples who are not married are referred to as "unmarried partners", same sex couples who are not in a civil partnership are referred to as "same sex couples". The rules are the same whether an unmarried or same sex partner.
The immigration rules require that the couple must be living together in a relationship "akin to marriage or civil partnership" which has continued for two years or more. This is interpreted by the Home Office and Embassies abroad to mean two years' cohabitation and strong evidence of this cohabitation will be needed.
If you plan to make an application yourself you must read the rules and the Home Office policy section thoroughly as this page only provides a very brief overview. The partners of EEA nationals should follow the European guidance specific to them.
The particular circumstances of a couple will dictate the appropriate place to make the application (in the UK or outside), the form to be used, and the length of stay to be granted.