A solenoid is a kind of electromagnet which is designed using helical coil of wire, it can be used a as controlled magnetic field.
A solenoid is comprised turns of a wire all over its length and when electricity is passed through that wire the core gets magnetized making this setup a magnet and as its due to electricity, its rightly called an electromagnet. It behaves like a magnet only till electricity is kept flowing otherwise it loses its magnetism hence it is also called a temporary magnet also. A bar magnet is a natural magnet and it behaves as such without any external influence. Its magnetic field or the area in which its magnetism can be observed is quite small compared to a solenoid which is a stronger magnet.
The magnetic field lines around (a) a bar magnet and (b) a current carrying solenoid:
If the solenoid is long and narrow, the magnetic field outside the solenoid is nearly zero while the magnetic field of a bar magnet is strong at any outside point.