Railroading is a GMing style in which, no matter what the PCs do, they will experience certain events according to the GM's plan. In general, this is considered a flaw, displaying a lack of flexibility, naturalness of the scenario, and lack of respect for meaningful choices by the players.
Railroading as a pejorative
Because railroading essentially negates the central activity of a role-playing game, it is generally used to refer to a dysfunctional role-playing style. Consequently, it is often used to characterize whenever the GM constrains PC choices to the detriment of the players' enjoyment.
When railroading is not bad
Obviously, some constraint on player choices is necessary, and many that are not necessary still enhance the game. One common occurrence is linear game design, in which the GM lays out expected game events ahead of time, using time, geography, and events to influence PC behavior. If they deviate from the planned adventure, the GM may use carrot-and-stick approaches to get them back on track. However, this situation does not become a true railroad unless the GM actively negates player choices simply because the GM did not like what they chose.