They will work, but there's a few things to be aware of. Firstly, SATA mercifully uses the same power and data connectors for both laptops and desktops and you can use a 2.5 inch hdd in a desktop system with no issues - its recommended you get an adaptor to mount the 2.5 inc drive into the larger bay, if your case is too old to support 2.5 inch drives. If its for short term use, it shouldn't matter. Most cases with a slide out drive caddy have a set of holes at the bottom of the caddy to install it.
Most modern systems are sata based. The nice thing about sata is the mechanical and electrical connectors are universal, and you can use any sata drive that physically fits in your system.
sata - this also needs a sata power connector from your power supply. This is what you should be using.
With older systems which used IDE drives, the laptop connector was significantly different from the desktop connectors and you'd have to get an electrical adaptor - this is not the case here.
desktop PATA these use a 40 pin connector - this also needs a molex connector from your power supply.
laptop PATA hard drives use a 44 pin connector which includes power. There's adaptors to convert a 40 pin desktop pata and 4 pin molex power supply conector into a 44 pin connector for plugging these into PCs.
There's also adaptors that convert between SATA and PATA and vice versa, should you need to plug in a PATA drive into a system with no legacy PATA ports, or a modern sata drive into an older system. This can be a bit hit and miss, depending on the system and your luck.