Formal:
* J'ai été votre élève. (Most literal translation, emphasizing the past tense)
* J'ai suivi vos cours. (Literally "I followed your classes", implying you were a student in their class)
Informal:
* J'étais votre élève. (Less formal and more common, implying you were a student at some point in the past)
* J'ai été dans votre classe. (Literally "I was in your class")
More specific:
* J'ai été votre élève à [School name] en [Year]. (Specifying the school and year you were their student)
The best option depends on your relationship with the person you are speaking to and the context of the conversation.