As one of several key components already mentioned by the emissaries, the catch word is quality and I would say the only way anyone will receive a quality letter of recommendation from faculty would be by having built a strong rapport with a faculty member. Before you approach the potential recommender, gather yourself appropriately by having a strong resume or CV as well as an overall record of engaging with your potential recommender. Essentially, as long as you give your recommender at least a 3 week notice AND have been consistently communicating with him or her then they will more than likely do their part and write a great letter.
The point is that by having engaged your potential recommender already, he or she may have an easier process in writing about your abilities and potential. Have confidence, be assertive, and set aside some time to have a serious conversation with your potential recommender and let him or her know ultimately how much the recommendation would be beneficial to you and what your own expectations are. As a general note, I would have several potential recommenders and consider how each could speak to your specific capacities to progress through graduate school.
For a summary see the link below to a recently released webinar specific to recommendation letters. Enjoy.