What if I can make a profit for an assignment/project I did similar to "Google"?
This cannot be answered in general.

It depends on the contract you have with the institution and the applicable law in your jurisdiction. It may depend on how you were funded as well.

I know of examples from both extremes: your university owns 100% and your university owns nothing, as well as everything in between. Some intermediate setting is probably more common, but, as I said, it depends.