If you allow users to upload large images, you might run into this problem even after upping the PHP memory limit. If this happens, I strongly recommend installing this module: Max Image Size.
Suppose you allow users to upload 10mb image files straight from their digital camera, without forcing them to use image editing software.
Without Max Image Size module, the uncompressed image data for that massive file is held in memory and manipulated multiple times for each image style. That consumes a huge amount of memory. For many-megabyte "straight from camera" images that'll often exceed any memory limit you could or would want to place on a web server for one user's process.
With Max Image Size, there's a step before that honking great image reaches GD, cleanly scaling it down once to a large-but-reasonable size (2560x1600 by default, this setting can be changed). All the image style manipulations are then done to that image using much less memory.
This also has the effect of capping the largest possible size another user would get if they click an "original image" link. Very occasionally this might be a problem (e.g. if you're selling professional stock images and need the original monster-sized file - though even then it might be better to upload a raw or tiff file as an untouched plain download alongside the JPG), but usually it's a good thing too. If a user is on mobile data and clicks a full-size image link, they'll normally expect something like a high-quality 2560x1600 wallpaper, not some beast that takes minutes to load and wipes out a substantial chunk of their data allowance.