Cajamarca is in dairy country and the local food reflects it — the region is famous for its manjar blanco (a thick milk caramel, similar to dulce de leche), queso fresco, and fresh cream. Look for these in the market and take some home. The city also produces good cuy (guinea pig), prepared roasted or fried, which is the traditional festive dish of the Andes.
The area around the Plaza de Armas and Calle del Comercio has the highest concentration of restaurants. For Peruvian classics — ceviche, lomo saltado, ají de gallina — you will find plenty of options at reasonable prices. The market on Calle Amazonas is the place to eat cheaply and well, with market stalls serving set lunches (menú del día) for a few soles.