If the smaller cubes that compose a larger cube or rectangular prism have an edge length of 1 whole unit, you may simply count how many cubes you see in each direction(Length width and height) and multiply to find the volume.  Sometimes smaller cubes that make up a larger figure are NOT one whole cubic unit.  For example, a cube may have an edge length of 1/2.  Therefore the volume of that individual cube would be 1/2 x 1/2 x 1/2 = 1/8 cubic unit.  This tutorial reviews how to find the volume of a cube when the smaller cubes shown has a fractional edge length.