A very basic explaination is this - the f number (ie f3.1 or f6.4) refers to the size of the hole in the lens - its aperture. Going from f3.1 to f 6.4 means the hole is being made smaller, so the shutter has to be open longer to allow more light through. The smaller the hole (ie the higher the f number is - in your case f6.4) the bigger the depth of field is. Depth of field means the amount of stuff that is in focus infront and behing the point of focus, so if you focus on a tree that is 10m away, everything from 9m to 12m will be in focus at f3.1, and using f6.4, everything from 8m to infinity will be in focus. However, the figures I am quoting are just for example, not accurate.
The relationship between the aperture (hole in the lens) and the shutter speed (time the shutter is open for) is an important one to learn, as for every f-stop you open or close the lens, you need to halve or double the shutter speed. I am sure there will be someone here who can produce a graph that will illustrate this way better than my clumsy attempts while I am burning the lunch !
Does that make any sense to you - it seems to to me, but if not to you then I will try again...!
As for the shutter opening for stars, I have no idea, but why not try a few different times to experiment - you will need a tripod or some other way to hold the camera still (a sock filled with dry beans or rice would do well) and a shutter release of some sort may also be good.