Yes, it most certainly does layers AND layer masks and the latest version even does content-aware fill (although not to the standard of CS6). If you start with LR4 and try to take on GIMP, it's a culture shock. If you start with GIMP and use the tutorials to get right inside it then it will come more easily. Only problem is GIMP doesn't do
RAW editing. You have to use Ufraw or DCraw or
Raw Therapee or ... can't remember the name of the BEST free
raw converter that's GIMP-compatible, but I'll dig it up if you're really interested. GIMP also doesn't do 16-bit editing ... yet. You have to be content with 8-bit colour depth. Otherwise it's brilliant and there are a host of add-on tools for photographic processing.
I started with GIMP, and still have it on my iMac along with PSE9 and LR5. I resort to it when I can't find what I want in PSE or LR ... pretty rare but who cares if it's free?