Gleason patterns are determined by examining prostate tissue samples under a microscope. Pathologists look for specific histological features such as glandular formation, cellular arrangement, and the presence of stromal invasion. The two most predominant patterns observed in the tissue sample are combined to form the Gleason score, which can range from 2 to 10.