When both of the objects describe the object vehicle in the same way, what is the difference between them?
They don't. Your first vehicle is an object; vehicle.wheels is 4. Your second vehicle is a function (also an object, but that's not really relevant here); vehicle.wheels is undefined because that function doesn't have a wheels property. You'd have to use var v = new vehicle(); and then v.wheels.
Use object initializers (your first example) when you need a one-off object. Use a function (like your second example) if you need a factory for objects that have the same shape.
Note that if your factory is a constructor function (a function that expects to be called with new, such as your vehicle function), it should be initially capitalized by (overwhelming) convention.
But your factory doesn't have to be a constructor function, it could be a function that just returns an object, in which case you woulnd't use it with new, wouldn't use this inside it, and wouldn't typically capitalize it. E.g.:
var vehicle = function(){
return {
name: "car",
wheels: 4,
fuel: "petrol"
};
}
(It could use Object.create if it wanted to assign the object a specific prototype.) Whether you use that and var v = vehicle(); or a constructor function and var v = new Vehicle(); is mostly a matter of style.