A solenoid is any physical device capable of creating a magnetic field that is extremely uniform and intense inside, and very weak outside. For example, a coil of insulated and helically wound conductive wire of indeterminate length.
In the next pic we can see what are talking about:
An application of solenoid is as an elegtromagnet. An electromagnet is a type of magnet in which the magnetic field is produced by the flow of an electric current, disappearing as soon as said current ceases. Electromagnets generally consist of a large number of closely spaced coils of wire that create the magnetic field.
The operation of the solenoid can be describe as follows:
An electric current flowing in a wire creates a magnetic field around the wire, due to Ampere's Law:
To concentrate the magnetic field, in an electromagnet the wire is wound into a coil with many turns of wire lying side by side. The magnetic field of all the turns of wire passes through the center of the coil, creating a strong magnetic field there.