Neurosis is the result of a conflict between the ego and its id, whereas psychosis is the analogous outcome of a similar disturbance in the relation between the ego and the external world.
Neurosis and Psychosis (1924), in James Strachey (ed.), The Standard Edition of the Complete Psychological Works of Sigmund Freud (1961), vol. 19