Can you use the sleight of hand skill to hide a larger weapon, such as a longsword, dragoon pistol, or light crossbow? Or is it only usable for lighter weapons?
Yes, with Shrink Item or a Sheath of Bladestealth.
The spell Shrink Item reduces an item to 1/16th its normal size, and optionally changes its composition into that of a cloth-like object. This would turn most any non-light weapon into "small object" (they effectively would no longer be weapons for a character your size) which the rules allow you to conceal. If the weapon is initially on the smaller size for a non-light weapon, or you use the option of turning the item into a cloth-like composition, the GM might rule it is an extraordinarily small object and give you the +4 bonus to your roll allowed for such objects. This would only work with non-magical weapons because the spell doesn't work on magical objects.
The Sheath of Bladestealth from Ultimate Equipment will accept "any bladed slashing weapon from dagger to Great Sword" (which presumably excludes hafted bladed slashing weapons) and make them and the sheath invisible. The character must roll Sleight of Hand to conceal the weapon (which can be larger than a light weapon) and gets a +5 bonus to the check. The weapon can still be detected by an opposing Perception check. This is the only published Pathfinder 1E magic item that allows you to conceal a non-light melee weapon using Sleight of Hand.
Other magic items, like a Bag of Holding, could conceivably be used to smuggle a non-light weapon somewhere, though that might not count as "on your person" and probably would be more contingent on a Sense Motive check by the guard than on any Sleight of Hand check by the character carrying the bag.
Otherwise, no for melee weapons, and possibly yes (GM's discretion) for ranged weapons.
According to the Sleight of Hand rules:
"You can hide a small object (including a light weapon or an easily concealed ranged weapon, such as a dart, sling, or hand crossbow) on your body."
So in terms of melee weapons, light weapons only. There are no class talents/abilities or feats that I could find that allow a non-light melee weapon to be concealed with Sleight of Hand. The Assassin prestige class becomes a "master at hiding weapons on his body" at level 4 and can add their Assassin level to their Sleight of Hand roll to conceal weapons on their person; but even these masters of the art are not permitted to hide larger than light melee weapons on their person under the rules.
For ranged weapons, according to the rules quoted above, it is at the GM's discretion whether a ranged weapon is "easily concealed"--except for darts, slings, and hand crossbows, which are explicitly defined as easily concealed in the text quoted above. A shuriken is also explicitly defined as easily concealed by the rules later in the skill description: "An extraordinarily small object, such as a coin, shuriken, or ring, grants you a +4 bonus on your Sleight of Hand check to conceal it..." Some ranged weapons would very likely be ruled easily concealed (net) while others almost certainly would not (composite longbow or heavy crossbow). I suspect that most GMs would rule that a light crossbow is not easily concealed, but I think most would at least consider allowing certain pistols to be concealed with Sleight of Hand. Situational factors, like wearing baggy or flowing clothes, might also influence what ranged weapons the GM allows to be concealed or doesn't.
Also worth considering: weapon and character size.
The rules for Sleight of Hand weapon concealment probably assume a weapon sized for the character on whose person it is concealed. A GM might allow a character to conceal a non-light weapon on their person if the weapon is sized for a smaller-sized character (e.g., a human (medium) might conceal a longsword sized for a halfling (small) as easily as he could conceal a shortsword sized for himself). While not explicitly permitted, such a ruling wouldn't be unreasonable for certain smaller-sized non-light weapons. In a similar vein, a GM could reasonably rule it impossible for a medium character to conceal certain light weapons sized for a large or larger character on their person. Note that if you were magically enlarged somehow, then your normal weapon (if not also enlarged) might become concealable also, depending on GM ruling.
Finally: Situational house rules.
As a parting thought, the players might try something not covered by the rules that would prompt a GM to allow a Sleight of Hand Check to conceal a non-light weapon somewhere other than on a character's person. Perhaps the PCs want to sneak a greatsword through a city gate by hiding it somewhere on a wagon. In such a case, the GM might rule that the Sleight of Hand weapon concealment mechanic applies, but the size limit on the weapon no longer does.