I assume you`re not doing any exercise now?So the main thing to start with is to go gently,say three sessions a week (combined) of cardio and weight training,and then gradually build up as you get fitter and stronger.Walking,running,swimming,cycling,rowing are all good cardio workouts.Add in some light weight training to tone and build muscle.Do no more than 30 minutes to begin with,then step up.Always do warm ups and cool downs before and after exercise.
To gain weight up to your ideal,you just need to eat more calories a day.You need this as you are pretty light for your height anyway.There`s probably good advice on your precise calorie needs on Realjock.Try to eat a diet of unrefined carbohydrate,lean protein,cut down on the fats(especially saturated animal types)lots of fruit and vegetables,etc.And eat regularly and frequently,don`t starve,then binge with food.
Make sure you take plenty of fluid,water is pretty good,and rest between workouts.
A gym would give you more individual advice and workout companions if you need them,etc.
Stick with your training.Consistency counts!Doing something regularly,even if light, will be much better than going mad once in a while.Be patient and you`ll soon see improvements.
All the best with your training!