I cycle to work everyday. I cycle about 12miles in total there and back. On my days off I get cramping pains in the top of both legs. Why?

Try a stretch. For example, sit on the backs of your heels and lean all the way back to stretch your quadriceps muscles, each morning and nighttime, whether or not you bike. See if this helps.