The teacher gave the patent.
The teacher applied before, and that belongs to the person who applied before. If you play an important role in the project you cooperate with your teacher, you have the right to write your name in the column of patent inventor when applying for a patent. You are one of the inventors. If your name was not written in the inventor when you applied, it's no use saying it yourself now.