How does the FAA determine which format of location identifier to assign to an airport?
In short, the scheme is as follows:

Busier airports get 3-letter identifiers.
Less busy public-use airports usually get 2 numbers and a letter, sometimes 1 number and 2 letters.
Less busy private airports (which is almost all private airports) get 2 letters and 2 numbers.


More specifically, the FAA assigns airport identifiers (and location identifiers in general) according to the guidance laid out in section 1-2-7 of JO 7350.9F (PDF).
3 Letter Identifiers
For airports, 3-letter identifiers are assigned to airports that meet the following criteria:


Airports:
(a) with a manned air traffic control facility.
(b) with a navigational aid (NAVAID) within airport boundaries.
(c) that receive scheduled route air carriers.
(d) that receive military airlift services.
(e) designated by the U.S. Customs Service as Airports of Entry.


or


Public use airports commissioning Automated Weather Observations Systems, level III (AWOS-III) or higher that have paved runways 5,000 feet or longer.


1 Number, 2 Letter Identifiers

Most one−number, two−letter identifiers have been assigned to aviation weather reporting and observation stations and special−use locations. Some of these identifiers may be assigned to public−use landing facilities within the United States and its jurisdictions, which do not meet the requirements for identifiers in the three−letter series.

The format of these codes is as follows:

In this identifier series, the number is always in the first position
of the three−character combination.

For example, 1AD would be a valid code.
2 Number, 1 Letter Identifiers

Most one−letter, two−number identifiers are assigned to public−use landing facilities within the United States and its jurisdictions, which do not meet
the requirements for identifiers in the three−letter series.

The format of these codes is as follows:

One−letter, two−number identifiers are keyed by the alphabetical letter. The letter may appear in the first, middle or last position in the combination of
three characters.

For example, 25M, 8M1, or M72 are all valid codes.
2 Number, 2 Letter Identifiers

Two−letter, two−number identifiers are assigned to private−use landing facilities in the United States and its jurisdictions which do not meet the requirements for three−character assignments.

The format of these codes is as follows:

They are keyed by the two−letter Post Office or supplemental abbreviation (listed below) of the state with which they are associated. The two−letter code
appears in the first two, middle, or last two positions of the four−character code.

For example, TN01, 1CA3, or 50SD would be valid codes.
The order continues to list a table of supplemental codes that can be used instead of the state's mail code. This allows for states whose mailing codes wouldn't work well as part of the identifier and also for states which need more than the 300 private airport registration codes possible with a given 2-letter sequence in this format.
Changes to Existing Identifiers
Airport identifiers are preferred to keep the same code once it's assigned, except in exceptional circumstances. According to section 1-2-4 of the same document:

Location identifiers are considered permanent and will not be changed without strong and documented justification, primarily concerning air safety or a significant change of landing facility status.

As a result of this, it's possible for an airport which now meets the qualifications for a 3-letter identifier to still have an identifier containing numbers due to it not having met the requirements for three letters when it was assigned. 8A3, Livingston Municipal Airport is an example of this. It has an AWOS-III and a paved runway longer than 5,000 feet, but still retains the code 8A3, which was assigned before the runway was lengthened.