For released packages you just type:
sudo apt-get install ros-"your ros
distro"-"package-name"
If you use ROS indigo and want to install the package image-view you just do
sudo apt-get install
ros-indigo-image-view
If the package is not released then you will need to install it from source code, click on the name of the package on the package's list page and find out where the code is hosted (mostly github), clone the package's repository in your workspace. then catkin_make. This is explained in detail in beginner's tutorials.
Now the problem with installing from source code is that you have to take care of the dependencies by yourself. whenever you see "Could not find a configuration file for package xxxxx" it means this package is missing and is needed for compiling your code. You could also try using rosdep which will automatically try to find all the dependencies of your package and install them.
which package you want to install, first get source by git clone and then build it.