From my experience, it is usually from usage, but seems to follow an informal rule that if it looks like a pronounceable word it is often used that way and usually more than 3 letters.
Examples of being used as a word are
NATO - North Atlantic Treaty Organization
FIFA - Fédération Internationale de Football Association
NAFTA - North American Free Trade Agreement
Examples of not
iOS - Apple's Operating System
AWS - Amazon Web Services
IOU - short for "I owe you"
IOC - International Olympic Committee
An exception is
IBM - International Business Machine
which does get pronounced as a word by people familiar with the company, usually in the context of I've Been Moved, referring to the extensive relocations which occur.