Dark magnetic spots crossing the stellar disk lead to quasiperiodic brightness variations, which allow us to constrain stellar surface rotation and photometric activity. The current work is the second of this series, where we analyze the Kepler long-cadence data of 132,921 main-sequence F and G stars and late subgiant stars. Rotation-period candidates are obtained by combining wavelet analysis with autocorrelation function. Reliable rotation periods are then selected via a machine-learning (ML) algorithm, automatic selection, and complementary visual inspection. The ML training data set comprises 26,521 main-sequence K and M stars from Paper I (Santos+ 2019, J/ApJS/244/21). To supplement the training, we analyze in the same way as Paper I, i.e., automatic selection and visual inspection, 34,100 additional stars. We finally provide rotation periods P_rot_ and associated photometric activity proxy S_ph_ for 39,592 targets. Hotter stars are generally faster rotators than cooler stars. For main-sequence G stars, S_ph_ spans a wider range of values with increasing effective temperature, while F stars tend to have smaller S_ph_ values in comparison with cooler stars. Overall for G stars, fast rotators are photometrically more active than slow rotators, with S_ph_ saturating at short periods. The combined outcome of the two papers accounts for average P_rot_ and S_ph_ values for 55,232 main-sequence and subgiant FGKM stars (out of 159,442 targets), with 24,182 new P_rot_ detections in comparison with McQuillan+ (2014, J/ApJS/211/24). The upper edge of the P_rot_ distribution is located at longer P_rot_ than found previously.