Scope is where a variable is visible. Local variables live inside a function and die when it ends. Global variables live outside all functions and exist for the entire program. Parameters are local.
Define int x inside a function, it's local. Define outside all functions, it's global. Locals shadow globals with the same name. Prefer local variables. Globals create hidden connections making bugs hard to track.
Keep data local unless you have a strong reason to share.