Better would be
I spent a lot of time, which i could have spent on my studies, chasing her.
Notes:
Although not wrong per se, the original sentence is confusing and awkward. The noun modifier is best placed right after the noun it is modifying.
There is also no "(in)". You spend time doing something not in doing something.
"lots of" is also rather colloquial, more proper would be "a lot of"