Can my girlfriend get pregnant when we did it with clothes on?
That becomes difficult to answer without more details of what you actually did, what you and she were wearing when you did it, and what happened to your semen.
If you are saying you humped your girlfriend, well, humping is slang for rubbing or bumping the genitals against someone or something in order to gain sexual stimulation. It isn't fornication, but fornication isn't the only sexual sin that can be committed. Paul warned, "It is good for a man not to touch a woman" (I Corinthians 7:1). By that, Paul is warning against sexual touching. Such touching is foreplay, touching that stimulates the body's desire for sex and prepares the body for sex.
The problem with sexual touching is that it creates lustful thoughts and desires for further action. People engaged in dry humping aren't thinking pure thoughts, they are thinking about sex but aren't bold enough to take their clothing off and risk fornication. "For from within, out of the heart of men, proceed evil thoughts, adulteries, fornications, murders, thefts, covetousness, wickedness, deceit, lewdness, an evil eye, blasphemy, pride, foolishness. All these evil things come from within and defile a man" (Mark 7:21-23). So while fornication isn't being physically done, it is playing out in the participants' mind.
Another problem is that far too many people naively think that this is as far as things will go. They don't count on the strength of sexual desire or its impact on their thinking. While dry humping seems "safe" because there is no intercourse, there still is a risk of pregnancy. In any sin there is a progression. People feel safe because nothing "bad" happened the last time, so it becomes justification to go further, longer, and take a bit more risk. Besides, the additional risks add excitement which keeps the senses alive and adds to the "fun." Eventually the guy will ejaculate. The sperm in his semen doesn't care how they get to an egg. They have tails to swim, so as long as they survive the journey, it is enough. Cloth isn't a barrier to semen. It reduces the amount delivered but doesn't completely eliminate it. If the two are touching each others genitals, fluids can moisten the clothing and provide a path for some sperm to travel to the vagina. From there it only a matter of one sperm surviving the journey to the egg.
Finally, in the pursuit of more excitement, it is rare for matters to stop with dry humping. I would like you to read one young man's account of what happened to him in "She wanted to save everything for her wedding night."
"For this is the will of God, your sanctification: that you should abstain from sexual immorality; that each of you should know how to possess his own vessel in sanctification and honor, not in passion of lust, like the Gentiles who do not know God; that no one should take advantage of and defraud his brother in this matter, because the Lord is the avenger of all such, as we also forewarned you and testified" (I Thessalonians 4:3-6).
While it is not fornication, dry humping when you are not married is still sinful.
Of course, what you did might not have been humping. You two could have reached underneath clothing to masturbate each other. It is still sinful because it involves sexual touching, lewd behavior, and lustful thoughts. People involved in mutual masturbation are usually careful about the fluids being produced. Sperm don't care how they get to the vagina so long as they are able to swim up to uterus and the fallopian tubes. You produce fluids, called pre-ejaculatory fluids (or pre-cum), when you are sexually aroused. That fluid may contain a few sperm. Get some on your hands or she on her hands and then put those same hands in or near her vagina and you have transferred sperm. Ejaculate and get some semen transferred and the odds just increased greatly.
What it comes down to is that anytime a male ejaculates with a female close by, there is a chance of pregnancy. The odds may be extremely small, but they are never zero.