What is the difference between roof repair warranty and material warranty?

Material warranty is from the shingle manufacturer. If a shingle delaminates or cracks prematurely due to a defect in production, the manufacturer replaces it. Timelines vary from 10 to 25 years depending on product grade. Read the fine print; some warranties pro rate, meaning a 15 year old roof that fails gets only a partial refund.
Workmanship warranty is from your contractor. They promise their labor and installation were correct for a defined period, typically two to ten years. If flashing they installed leaks, or if shingles start lifting because they nailed incorrectly, workmanship warranty covers it.
What's actually covered
Material warranty doesn't cover weather damage, impacts, or poor installation. Workmanship warranty doesn't cover acts of nature or material defects. If a storm tears off your roof, neither warranty pays for it; homeowners insurance does.
Getting it in writing
Before you hire, ask the contractor for their standard warranty terms in writing. Know the period, what's covered, what voids it, and how claims are filed. Some contractors offer extended warranties as a selling point; verify these are actually backed by them financially. A cheap contractor with no warranty is usually more expensive in the long run.