I did this when I was 12, and I didn't know what this all was. My 12-year old mind was still working like a 6 year old. One day a letter came to my house saying you are not eligible or something, I can't remember. My dad found out about this and I was given a big punishment and he told me everything SSNs and credit cards. I did not do anything illegal since then. Am I in trouble? I am a legal immigrant but not a citizen in the US. I did not actually get any money and the owner of the SSN didn't get affected in anyway, so what is going to happen to me?
The fact that you committed what would probably be a crime if committed by an adult when you were 12 doesn't in and of itself have any consequences unless you are prosecuted for an offense before the statute of limitations runs. And, to the extent that it is a felony (this might very well be only a misdemeanor or a juvenile offense that has a statute of limitations because it is a juvenile offense in most jurisdictions), some states (e.g. Virginia) don't have a statute of limitations at all.
The fact that the application was denied and no harm was done to anyone likely severely reduces the seriousness of the offense, so it might only be a misdemeanor if it was committed by an adult.
Certain kinds of adult criminal convictions make people who do not have U.S. citizenship deportable, although ICE doesn't always manage to deport people who are eligible for deportation on this ground.
Subject to special exceptions for certain offenses which aren't applicable here (e.g. murder), a 12 year old cannot be prosecuted as an adult offense in any U.S. state or territory. Applying for a credit card with someone else's Social Security number without receiving any economic benefit, is almost surely not an exception, to the bar on prosecuting someone as an adult for offenses committed when 12 years old.
This means that any offense would be a juvenile delinquency prosecution, which involves a secret trial without a jury, much shorter sentences for the same offenses (that would be served in a juvenile detention center rather than an adult jail or prison if incarceration was ordered), and the sealing of the record of the conviction when you become an adult.
A juvenile delinquency adjudication (i.e. conviction) does not make you deportable the way that many adult criminal convictions do, but they do have to be disclosed on immigration forms such as applications for adjustment of status to permanent residency (I-485), and applications for naturalization (N-400) and once juvenile adjudications (i.e. convictions) are disclosed:
They can be used to bar a finding of “good moral character”, which is a requirement for naturalization and other forms of relief from deportation such as cancellation of removal. Also, as a discretionary matter, Immigration Judges can view juvenile activities as a negative factor when considering any application for relief from deportation.
Generally speaking, if you do gain U.S. citizenship, you can't be deported for crimes committed prior to obtaining U.S. citizenship.
There are very narrow exceptions for inaccuracies in citizenship applications that can lead to revocation of citizenship, but a failure to disclose in a citizenship application the fact of having purportedly committed a non-violent, regulatory offense (i.e. one that doesn't harm anyone), as a 12 year old, that does not result in a juvenile adjudication (i.e. conviction), would not be grounds for revocation of someone's U.S. citizenship.
Realistically, if no one has commenced a juvenile delinquency prosecution in the last two years, no one ever will. So, you should forget about it and not mention it.
According to UNICEF:
In the US, the age of criminal responsibility is established by state law. Only 13 states have set minimum ages, which range from 6 to 12 years old. Most states rely on common law, which holds that from age 7 to age 14, children cannot be presumed to bear responsibility but can be held responsible.
So it appears that you could be prosecuted for fraud, but the prosecution would have to show that not only did you do the fraudulent act, but that you were sufficiently mature to be held responsible for it. Your comment "My 12-year old mind was still working like a 6 year old." suggests not.
In practice, if this was two years ago and you have heard nothing yet, there is very little chance that anyone will care. (There is also a principle of limitations which says that after a certain time has elapsed, crimes cannot be prosecuted.)
It very much depends on the country, but there is a big difference between a 12 year old and a 14 year old doing something. If you did this two years ago and haven't been prosecuted or had a visit from the police, you are most likely fine.
In your case, nobody has noticed that something wrong has happened. Someone applied for a credit card, and was refused. Happens thousand times a day. So nobody will ever know you did something wrong unless you tell them.
If you used your dad's SSN, and you had got the credit card, and spent money, then most likely your dad would have repaid the money out of his own pocket and covered for you. (Instead of being in trouble with your dad you would have been in really, really big trouble with him). Still, nobody other than your dad would know about it, so no trouble with the law.
Again: Nobody other than you and your dad knows that you have done anything wrong. If the police knew, then (a) I wouldn't be sure at all that this would be a felony since it never got to a stage where the slightest damage was done, and someone would have to prove that you intended to get money and not pay it back. (b) you were twelve at the time, which makes a huge difference. (c) it would be almost impossible to prove. Even if your dad told the police and it went to court, it would be your word against his. So nothing is going to happen.