Smith-Purcell radiation (SPR), emitted when a charge passes above a periodic grating, is important for applications such as terahertz production and nondestructive bunch-length diagnostics. The grating width is shown to become an important parameter for accurately predicting the radiation, and especially in the highly relativistic regime where the charge wakefield considerably stretches in the transverse direction. The SPR radiation is rigorously calculated by the electric-field integral equation (EFIE) method for a grating of finite width and length. The integral equation is arranged as a multilevel block-Toeplitz matrix by using symmetry under translation with respect to the grating period and width directions. Following Barrowes et al. [Microw. Opt. Technol. Lett. 31, 28 (2001)] enhanced computational efficiency can be achieved by matrix to vector projection of the essential matrix elements. A numerical example is calculated for a relativistic ($\ensuremath{\gamma}=36$), 1-mm long, bunch traveling 0.6-mm above a ten-period grating with a period of 2.0 mm and width of 10 mm. The SPR resonance relationship and its broadening due to the finite number of grooves are consistent with the closed-form formulations. The surface current was shown to be concentrated along the center of the grating and decreasing towards its edges. The surface current, power spectrum, and radiated energy were compared to the EFIE formulation in which an infinitely wide grating was assumed. The above parameters resulted in considerable difference of up to a factor of 2.5 between the finite width and the infinitely wide grating assumption, which means that for accurate calculations the grating width should be taken into consideration. A general rule for the required grating width to achieve an accurate SPR radiation result relative to the infinite width result, and the expected accuracy by the infinite width assumption for most radiation angles, is provided.