What training is required for a class B endorsement? 14 CFR 61.95 requires solo student pilots to have an endorsement to (a) fly through class B airspace or (b) takeoff/land at a class B airport.  However, the requirements to get it are pretty vague:

(1) The student pilot has received both ground and flight training from an authorized instructor on that Class B airspace area, and the flight training was received in the specific Class B airspace area for which solo flight is authorized;

There are similarly vague training requirements for Recreational pilots in 14 CFR 61.101(d) and Sport pilots in 14 CFR 61.325.
Is any particular content or amount of time expected, or is it at the CFI's sole discretion to decide when a given pilot is competent enough to endorse? Does the training itself need to be logged as such, separate from the endorsement?
I can not find any guidance other than what you have already noted for Class B airspace endorsements. The ground and flight training requirements seems to be left up to the discretion of the CFI. Though, it seems to be very similar to a solo endorsement as having criteria that is subjective to student and instructor.
Similar to a solo endorsement, a conservative CFI would only endorse the student for a specific airport, in a specific Class B airspace (and not the actual Class B airport), for a specific timeframe, and specific conditions. Even though the endorsement must be given within the preceding 90 days of the flight, the conservative CFI would specify a specific date and time instead of a blanket authority.
That being said, your entire logbook would then serve as a record of adequate training. Previous corresponding flights with the CFI would be logged in the logbook as evidence of training.