There are many ways of masking objects with GIMP. This tutorials shows a way that produces good results for fine details like strands of hair, especially for portrait photos with a simple background.
View The Tutorial.