These sand dunes are a type of aeolian bedform and partly encircle the Martian North Pole in a region called Olympia Undae.
Unlike most of the sand dunes on Mars that are made of the volcanic rock basalt, these are made of a type of sulfate mineral called gypsum. Whence the sand? Well, gypsum is a mineral that can often form from the evaporation of water that has sulfur and calcium dissolved in it. This sand was probably sourced from a northern region on Mars that used to be quite wet. The boxy gridding of the dunes indicates that the wind blows in multiple directions. [More at link]