The gauge cell Monte Carlo method is extended to calculations of the incremental chemical potentials and free energies of linear chain molecules. The method was applied to chains of Lennard-Jones beads with stiff harmonic bonds up to 500 monomers in length. We show that the suggested method quantitatively reproduces the modified Widom particle insertion method of Kumar [S. K. Kumar, I. Szleifer, and A. Z. Panagiotopoulos, Phys. Rev. Lett. 66(22), 2935 (1991)], and is by an order of magnitude more efficient for long chains in terms of the computational time required for the same accuracy of chemical potential calculations. The chain increment ansatz, which suggests that the incremental chemical potential is independent of the chain length, was tested at different temperatures. We confirmed that the ansatz holds only for coils above the θ temperature. Special attention is paid to the effects of the magnitude of adsorption potential and temperature on the behavior of single chains in confinements that are comparable in size with the free chain radius of gyration. At sufficiently low temperatures, the dependence of the incremental chemical potential on the chain length in wetting pores is superficially similar to a capillary condensation isotherm, reflecting monolayer formation following by pore volume filling, as the chain length increases. We find that the incremental gauge cell method is an accurate and efficient technique for calculations of the free energies of chain molecules in bulk systems and nanoconfinements alike. The suggested method may find practical applications, such as modeling polymer partitioning on porous substrates and dynamics of chain translocation into nanopores.