Another question touched on this issue, but I wanted to ask in more detail. Mar is a noun that can be masculine or feminine. I have heard that there are subtle differences in connotations between the two (for example, one gender is more often used in certain contexts, or one sounds more poetic or emotional). What exactly are the difference senses that each gender has? Are these connotations universal through the Spanish-speaking world, or are there regional differences as well?
As RAE states in the website it's an ambiguous name, i.e. it accepts both genders, so grammatically it would be correct to use any of them, unless for the expressions given there which just accept one.
Depending on the region one is more used than the other. For example in Spain the people who live close to the sea (sailors) tend to say "la mar", though in the rest of the country people use more "el mar". Also, "la mar" sounds more poetic, so it's probably more used in poems.
Anyway, there are expressions which are more typical to be heard with one gender (at least haven't heard in the other way), for example:
Bajo el mar
En el fondo del mar
la mar de (when it means much) e.g. Había la mar de gente - this can only be used in femenine.
When speaking about the kind of the sea we have today it's usually only in femenine, e.g. these ones: