Just keep playing them over and over until you can do it without even thinking. If you mean you have trouble memorizing a whole song, just practice a few measures at a time until you get the whole thing down.

The key here is practice though.
Practice is definitely the key here. When I learn a song I usually play the song about 5 times a day for about a week looking at the tab then I have it down pat, although I just learned Yellow Ledbetter and I played it about 15 times the day I learned it (drove my roommates nuts) and had it memorized the same day. My everyday practice lists are about 2 and a half hours worth of songs and each day of the week has a different set of songs to play, and I never get them confused unless the songs have similar chord structures or riffs (like audioslave has several riffs that use the same frets and strings which can throw one off from time to time). The thing is after practice you should have no problem keeping the songs separate. As far as writing your own stuff, write your idea down as a tab or otherwise, then do the same as learning different bands' songs, practice. And take it one song at a time. Learn one song, memorize it, then move onto the next.
Make sure you actually now a song before trying to learn to play it - if you don't know exactly what it's supposed to sound like all the way through then of course you're going to struggle to remember how to play it.
Actually called Mark!

Quote by TNfootballfan62
People with a duck for their avatar always give good advice.

...it's a seagull

Quote by Dave_Mc
i wanna see a clip of a recto buying some groceries.