a compressor is hard to describe soundwise, but yes it can make the notes sustain for a long time, you will also get more noise. how much more noise depends on the quality of the compressor.
annother common way to make the notes sustain longer is by turning the amp up to a louder volume.how loud you need to go, depends on the type of amp , guitar ,and pickups.
my friend has a Danelectro guitar and it has almost too much sustain(feedback) !