What you call a long dash is referred to as an em dash. That's because the width of that dash is nearly equal to the letter 'm'. Narrower than that is an en dash and even narrower is a hyphen.
We generally do not put an space around the em dash but a single space around it is not uncommon as well.
A good piece of information is here on The Punctuation Guide. An excerpt from that article is pasted below.
The em dash is perhaps the most versatile punctuation mark. Depending on the context, the em dash can take the place of commas, parentheses, or colons—in each case to slightly different effect.
About the space for 'em' dash on the same page:
The em dash is typically used without spaces on either side, and that is the style used in this guide. Most newspapers, however, set the em dash off with a single space on each side.
Most newspapers — and all that follow AP style — insert a space before and after the em dash.
Be careful while making them. There is a special way to type them on different OSs. An article from Wikipedia is here.