To protect your iPhone with a password, go to Settings, General, Passcode Lock and then click on Turn Passcode On. For Android devices, go to Settings, Location and Security, then Screen Setup Lock.
For your password, consider not using a swipe pattern despite its convenience because someone who gets a hold of your phone could potentially see the pattern from your fingerprints. A good practice instead is to repeat numbers, like 10150 for example. This prevents someone from seeing which numbers you are using most often and guessing if you only use each one once.
Also consider signing up for a backup service that can store all your pictures and contacts online, and wipe all the data from your phone if you lose it. Be sure to contact your carrier immediately if you lost your phone to prevent unauthorized use.