Not every application for a visa will be given the go-ahead. Having a refusal for a visitor visa can be based on many reasons. The most common (section 214(b)) tends to be that the applicant could not show strong enough ties to their home country so the immigration system did not consider their return home a strong enough possibility. If the embassy/consulate officer does not believe that you will return home then they will not issue you a visa.
Sometimes a visa is refused (under section 221g) because the application did not contain all the necessary information or the documentation provided was not right. In other cases, you may be refused a visa because you have recently returned from a trip to the U.S. and the officer does not think you have stayed long enough at home between trips to show strong enough domestic ties.
The good news is that, in most cases, you can re-apply for a visa at any time. So, for example, if you are a student and you are turned down but then, get a job, buy a house and re-apply then your application may have changed favorably enough to be reconsidered. Students are notoriously rootless but being employed and having a mortgage gives you the kind of domestic commitments that may swing in your favor.
The bases for visa refusal are given to the individual embassy/consulate that issues the visa. Their officers are the ones that make the day to day decisions in most cases based on the law as it stands in the U.S and the individual merits of each application/applicant that they see. In some cases, your visa application may be referred back to the U.S. and the decision will be made there.
You will either be told at interview or by letter that your application has been rejected. A letter, for example, will give the reason for denial which may help should you decide to re-apply.
There is no time limit or limit on the number of times you can apply for a visitor visa although it is wise to only do so if you are sure that your circumstances have changed or that you can now provide information that may have been missing for example. Otherwise you may well find yourself rejected for the same reason again. Also, bear in mind that you will have to pay the non-refundable application fee every time you apply for a visa. The fee paid for a rejected application will not carry over to re-applications.