Applications for U.S. Citizenship are made by filing Form N-400 with USCIS.
In order to apply for U.S. Citizenship, it is necessary, first of all, to have been a lawful permanent resident for at least 5 years. Spouses of U.S. Citizen can apply after only 3 years. If the application if filed too early, it will be denied. The law allows an applicant for U.S. citizenship to file the application yup to 90 days before the 5th or 3rd anniversary of becoming a lawful permanent resident.
At the citizenship interview, a civics as well as an English proficiency tests will be administered by the immigration officer. To pass the civics tests, it is necessary to respond correctly to at least 6 out of 10 questions. If the applicant fails the tests, it will be given the opportunity to repeat the exam within 90 days. If the applicant fails again, the application will be denied.
The other and most important requirement to become a U.S. citizen is to be a person of "good moral character". Many U.S. Citizenship application are denied for a finding of lack of good moral character. The most frequent ground for a finding of lack of good moral character is having reported a criminal conviction within the statutory period (5 years preceding the application – 3 years for spouses of U.S. citizens). However, evidence of other bad acts, such as lying to an immigration officer, can be valid grounds for a denial.
Finally, U.S. citizenship applications can be denied when, upon review of the immigrant's file, USCIS realizes that lawful permanent residency was granted in error. If the error is discovered within 5 years of the original admission as a Green Card holder or approval of adjustment of status, USCIS can also refer the case to the immigration court.
If you had Citizenship denied due to good moral character you should contact an immigration lawyer to see if you can file an appeal.