Firstly we'll quickly deal with a common misconception -- it doesn't matter if you're releasing your games for profit or for free -- Intellectual Property rights (that is, copyright and trademarks) still apply either way, and if you're infringing upon someone else's rights you may receive a cease & desist notice or be sued either way.
That being dealt with, as I briefly touched on above the laws you're dealing with fall under "intellectual property protection", and the ones that concern you are:
- Trademark: deals with distinctive names and/or markings used in trade. Examples include the name "Microsoft", and the Nike "Swoosh" (tick shape).
- Copyright: protects the expressive form of an idea. Examples being a book, or a piece of artwork.
Patent law can occasionally apply, but isn't something you're likely to have to concern yourself with. A patent protects a process by which something is achieved.
So, you can't use someone else's trademarks without their permission. In video-games this will usually mean the names of existing games (as well as movies, books, etc.!), major characters (you can use the common name "Tom", but you can't use the specific name "Lara Croft"), and logos. Don't use any of these things. Trademarks also only apply to the market in which you are trading -- there is an "Apple" computer company AND an "Apple" music label for example.
You also can't use someone else's copyrighted material without their permission. This means you can't use the dialogue, instructional text, sound effects, graphics, etc. from an existing product, and also applies to "derivative works", meaning that you shouldn't base your own work on an existing piece of work; i.e. if you create your own version of Mario or Sonic, it is a derivative work and you're still using copyrighted material.
All that being said, you can't generally apply any of the above protections to game-play, so as long as you create (or legally obtain) all your own artwork, sounds, text, etc. and don't use any trademarked names or logos you're able to make a game that is played in the same way as another. For example, you can make a "falling block game", but you can not make "Tetris".
One last quick note, I'll briefly mention "Fair Use", which gets brought up almost every time intellectual property is discussed. Fair Use is an exception to copyright laws which can apply in certain situations, and allows you to use copyrighted material without permission. Examples might include quoting a copyrighted piece of text, or making a parody version of a song. The problem however is that there are no strict rules or limits on what exactly constitutes fair use -- there's no percentage of a work or amount of words (I recall an example where someone was sued for using just 6 words from a speech) that are definitely safe to use, and only a judge can decide if fair use applies in any particular situation -- don't fall for the trap of assuming fair use will definitely protect you.
To summarise, you should be fine as long as you check that the names and titles you want to use aren't already in use, and as long as you aren't using anyone else's artwork, sound effects, help text, dialogue, etc.
...and finally, I am not a lawyer, and if you're concerned about this and want to be absolutely sure you should consult with one.
Does that help? <img src="smileys/smiley1.gif" border="0" align="middle" />