Gallon is an imperial and U.S. customary unit. There is one type of gallon in imperial system and 2 types (liquid and dry) in united states customary system. It is widely used in daily life, such as measuring the fuel efficiency as miles per gallon, etc. The abbreviation is "gal".
Cup is a volume unit and used mostly in cooking to measure liquid and bulk, dry foods. There is no international standard for cup sizes but mostly united states customary and metric cups are used and they are different in sizes.