The devil is in the details here. Specifically:
- Are you recognized as a common law partnership or something similar?
- Can you prove that you gifted her this money?
- Can you prove that the gift was conditional on getting married?
A married couple in this situation can argue for some fair division of common property. Sometimes it is based on who put in how much, sometimes it is based on who is seen as more "deserving", sometimes it is based on other things. It all depends on what divorce courts are like in your location. However if you are married you are potentially automatically entitled to some share of the common property. If you are not married and "just girlfriend/boyfriend" the state doesn't care and you have no leg to stand on.
The catch is that you don't necessarily need to do a full official marriage to be treated as a married couple in this respect. In many jurisdictions, people doing things like living together, buying a house together and presenting themselves to people as a couple are considered common law married which means they get to "enjoy" similar proceeding to a married couple getting divorced (such as asking for part of the property). The law is less strict for common law marriage than a full marriage, but it is a very similar concept.
If you don't qualify as common law marriage, your next option is to argue that the gift constitutes a contract for marriage as others pointed out. It's not enough that you "assumed you would get married" - you have to show that she was aware and accepted this as part of the engagement. This is easy with engagement rings because everybody knows that an engagement ring is given with the assumption of marriage, not unconditionally. You don't have to do much to convince the court of the condition. Gifting money for a house is not universally considered part of a normal engagement, so if you go to court on this basis the girlfriend can argue that you gifted the money with no strings attached or that you decided to pay the downpayment so that you could live in the house for a while instead of renting your own place and now you've gotten your money's worth, etc. It will be on you to prove otherwise.
But keep in mind this all hinges on your ability to prove the facts of the case. If the agreement was verbal between you two, she can say it didn't happen and then it's your word against hers. Or if you just handed her a stack of dollar bills, she can deny that the gifting happened at all. So if you don't have documentation, and you don't fall under common law marriage, I think your chances are slim.
Either way, the only way to be sure is to speak with a lawyer who deals with marital law. They will give you the final answer of whether you can sue, on what grounds and what your chances are. Alternatively, you can appeal to your girlfriend's sense of fairness and honor and ask her to voluntarily return the money.