A right is defined by the Oxford dictionary as "a moral or legal entitlement to have or do something" which basically means rights are things you are allowed to do which no one can prevent.
The idea of where rights came from stems from two ways of thinking which are natural law and positive law.
Natural law is a law theory which believes that our laws come from an unchanging set of rules and morals.
Positive law, contrary to natural law, believes that laws are just what lawmakers say.
Sources
Natural Law. (n.d.). Retrieved October 15, 2015, from http://www.iep.utm.edu/natlaw/
(“Natural Law,” n.d.)