Empathy can be measured in many different ways. As this source outlines:
Psychologists distinguish between measurements of situational
empathy—that is, empathic reactions in a specific situation—and
measurements of dispositional empathy, where empathy is understood as
a person's stable character trait. Situational empathy is measured
either by asking subjects about their experiences immediately after
they were exposed to a particular situation, by studying the “facial,
gestural, and vocal indices of empathy-related responding” (Zhou,
Valiente, and Eisenberg 2003, 275), or by various physiological
measures such as the measurement of heart rate or skin conductance.
Empathy is influenced by a very wide range of factors. Some are innate (e.g., one's capacity for empathy), some are due to upbringing and some are related to the characteristics of the individual or group involved (e.g, their familiarity, or appearance). I couldn't find a comprehensive list of these different factors (probably as there are too many), but [1,2,3,4] should give you a sense of the range of factors.
Please let me know if you require any further clarification such as a more specific question.
1 McDonald, Nicole M., and Daniel S. Messinger. "The development of empathy: How, when, and why." Moral Behavior and Free Will: A Neurobiological and Philosophical Aprroach (2011): 341-368.
 JACKSON, P. L., MELTZOFF, A. N. & DECETY, J. 2005. How do we perceive the pain of others? A window into the neural processes involved in empathy. NeuroImage, 24, 771-779.
 GALLESE, V. 2003. The roots of empathy: The shared manifold hypothesis and the neural basis of intersubjectivity. Psychopathology, 36, 171-180.
 CHAPMAN, E., BARON-COHEN, S., AUYEUNG, B., KNICKMEYER, R., TAYLOR, K. & HACKETT, G. 2006. Fetal testosterone and empathy: Evidence from the Empathy Quotient (EQ) and the “Reading the Mind in the Eyes” Test. Social Neuroscience, 1, 135-148.