Again, this is general advice for gen 5 OU. If you want to ask questions about your specific team, please post the team in the Rate my Team section with full movesets (moves, items, abilities, EVs, and natures).
Short answer: As a general trend, Skarmory leans more towards fatter/stallier teams whilst Ferrothorn leans more towards offense.
Detailed answer:
Skarmory is an outright wall and more reliable Spiker as it has access to Roost and a defensive typing that gives it more free turns to set-up hazards - a meta full of offensive Ground-types gives Skarmory lots of entry points and Spike turns. It is relatively easy to spin in front of Skarmory, so its job is more about attrition - i.e. it fits on teams that want to play a longer game where Skarmory might come in to set-up Spikes many times. Skarmory's defensive typing + access to reliable recovery also makes it a consistent and hard answer to many physical attackers in the format such as Dragonite, and some Garchomp/Excadrill.
Ferrothorn is more of a jack-of-all-trades / role compression mon. With two very strong STABs in Power Whip and Gyro Ball, as well as access to Knock Off, Thunder Wave and the like, Ferrothorn is legitimately difficult for teams to swap into. The trade-off is lacking proper recovery, so it ends up playing more like a Spiking tank (sometimes even running +Atk natures) rather than a wall like Skarmory. In the same vein, its typing makes it a one-off check to a lot of things, rather than a dedicated counter to a select few like Skarmory is. All this just means Ferrothorn slots more onto offense, where it might get a Spike or two, and then aim to keep those Spikes up by being hard to swap into and by being paired with offensive Pokemon that also make the opponent think twice about trying to spin. Almost always paired with a dedicated revenge killer because you aren't relying 100% on Ferrothorn to beat anything lategame.
examples:






This runs Skarmory because the team is slow and weak + relies a lot on the longterm damage of Spikes to make progress. Many of the partners are also easily spun on by Starmie and Excadrill with low risk, so you need to be able to get those Spikes back up multiple times. This team also doesn't run any speed control so you need your steel to be super reliable into DD Dragonite etc. In theory, the team only has 1 water resist so on paper would benefit from Ferrothorn, but in practice it just gets worn down too quickly to be work on stuff like this.






Ferrothorn fits more on teams like this which are more offensively driven. It might only be able to get 1-2 Spikes, but this team is way harder for the opponent to find spin turns against (the spinnable mons are all capable of heavily damaging or KOing the spinner, which dissuades hazard removal), so you don't need the long-term reliability that Skarmory gives you. Instead, you get the benefit of Ferrothorn's potent dual STABs, its additional resistances to be a situational check to almost anything when at high HP, access to Knock and Thunder Wave etc. You probably have a failsafe Scarfer or Sash Alakazam here so you don't need a steel that lives forever, either.












There are always some exceptions to this, though they are more niche. Skarmory has a suicide lead set that abuses Sturdy + Custap Berry + Brave Bird recoil to guarantee early hazards, then tries to win from 6-5 down (protecting from spin with Jellicent). These are always a bit janky but they are viable. In the opposite direction, it used to be trendy to run Ferrothorn on rain stall, paired with Rapid Spin Tentacruel and Wish Chansey to make up for its low survivability. So there's no 100% rule here, but the stuff above is true in most cases.
source