How many pictures can a 4 GB memory card hold with a 7 megapixel camera?

The capacity of a card indicates the maximum amount of data that can be stored (less some space for the card's own use).

Megapixel (MP) count refers to the maximum resolution of the camera's sensor -- its ability to record detail. The number of images that can be recorded on a card of a given size is only indirectly related to the capacity of the card, which is measured in Kilobytes (KB) or Megabytes (MB), not MP. That will vary according to the image itself, and to the camera's settings.

For example: My Pentax K10D, with a 10.1 MP sensor and using a 4 GB card, will record approximately 821 images at the highest resolution (10 MP) and a "Fine" resolution setting. The same camera, with the same sensor and same card, will record 10,000-plus images at the lowest resolution (2 MP) and the "Low" resolution setting. Practically all cameras have this ability to change the resolution settings, and thus the sizes of the image files that are stored on the card.

So, you can see that it is only possible to answer your question in very general terms: The higher the capacity of the card, the more images you can store at whatever camera settings. And, as you can see above, even at the highest settings with a high MP count, you can take a lot of pictures!

One thing to think about: storage cards can and do fail. It is better to have two 1 GB cards than one 2 GB card, unless you plan to shoot a whole lot of video. That way if one fails, you can keep shooting and worry about retrieving the images off the other card later.