A five year field experiment was conducted to evaluate the effect of continually returning cotton straw or biochar on microbial metabolic function and bacterial community composition of soil in a cotton field under drip irrigation conditions. The experiment involved three treatments:control (single application of chemical fertilizer, CK), cotton straw (returning of cotton straw plus chemical fertilizer application, ST), and biochar (returning of cotton straw biochar plus chemical fertilizer application, BC). The returning of cotton straw and biochar both significantly increased soil organic matter, total nitrogen, and available nutrients, but the effect of returning biochar was more significant. The carbon source metabolic activities of the soil in the ST treatment was the highest, followed by the BC treatment, which was significantly higher than of that in the CK treatment. The returning of cotton straw promoted the metabolism of carbohydrate and amine carbon sources, while biochar significantly increased the metabolism of polymer carbon sources. Compared with the CK treatment, the ST treatment significantly increased the phylum of Proteobacteria, Actinobacteria, Bacteroides, and the family of Xanthomonadaceae, Acidobacteriaceae, Microbacteriaceae, and Cytophagaceae. The BC treatment significantly increased the phylum of Acidobacteria, Gemmatimonadetes, Nitrospirae, and the family of Blastocatellaceae (subgroup 4), Gemmatimonadaceae, and Nitrosomonadaceae. The correlation analysis showed that there were significant positive correlations between the relative abundances of Xanthomonadaceae and Acidobacteriaceae and the carbon source metabolic activities of carbohydrates, amino acids, carboxylic acids, and amines. The relative abundances of Microbacteriaceae and Cytophagaceae were positively correlated with carbohydrates and amines. There was a significant positive correlation between the relative abundance of Blastocatellaceae (subgroup 4), Gemmatimonadaceae, Nitrosomonadaceae and the carbon metabolism of polymers. These results suggest that the continual returning of biochar increased soil nutrients, change bacterial community composition, and promoted the metabolic activity of polymer carbon sources in the drip-irrigated cotton field.