Actually they are two different things: (At least in Spain)
Gorro, is a round piece of cloth or wool for the head, and normally has two pieces of string to tie under the chin.
Gorra, is a cap. Very similar to the mentioned before, but has a peak at the front. "Gorra" is usually used to protect oneself from the sun, while "Gorro" is protect oneself from cold.