A synthesis of new 2,6-disubstituted and 2,6,8-trisubstituted 7-methylpurines as well as 8-substituted 3,7-dimethylxanthines containing a triple bond chain have been worked out. Purinethiones and xanthinethiones were converted into propynylthio derivatives, which were then further transformed via a Mannich reaction into aminobutynylthio derivatives (amine = pyrrolidine, piperidine, morpholine, and diethylamine). The products thus obtained represent various types of the purine and xanthine structure: 8-mono-, 2,6- and 6,8-dipropynylthio, 6- and 8-monoaminobutynylthio, 2,6- and 6,8-diaminobutynylthio derivatives. All of these compounds were tested for their anticancer activity against human glioblastoma SNB-19, human adenocarcinoma MDA-MB-231, and melanoma C-32 cell lines. The anticancer activity depends on the nature of the substituent and its localization in the purine and xanthine framework. Generally, compounds possessing two alkynylthio groups (propynylthio or aminobutynylthio) were more active than those possessing only one group. Some compounds exhibited stronger or similar anticancer activity to cisplatin. All compounds were also tested for their cytotoxic activity against normal human fibroblasts (HFF-1). The most promising anticancer compounds were found to be 2,6-dipropynylthio-7-methylpurine 4, 2-chloro-6,8-dipropynylthio-7-methylpurine 14, and 2-chloro-6,8-di(N-morpholinylbutynylthio)-7-methylpurine 15c acting selectively on glioblastoma SNB-19, melanoma C-32, and adenocarcinoma MDA-MB-231 with the IC50 = 0.07–4.08 μg/mL.