What is this and can it be used to stop the flow of water?
Having replaced a couple of those before in my own home, I am virtually 100% certain it is a pressure regulating valve. You can tell from the bell housing on top that it is what I say it is. See that all the examples I've shown below show the same bell housing, with a bolt on the top, and even a metal tag hanging off that bolt.



While the bolt can be turned with a wrench to adjust the pressure in your house, this is not a water shut-off valve, nor would I try to use it for that purpose.

Note that the valve has seen some time since installation and trying to completely turn off the water using it, EVEN IF YOU COULD DO SO, will very possibly cause it to completely fail to do its job properly in the future, thereby causing yet a different plumbing problem to solve later.