Get longest strings in jsonb column
If you have a flat JSONB structure, ie. no objects and arrays exist as values, then the solution is simple.  

Given the following table and data:

CREATE TABLE jsonbtest (data jsonb);

INSERT INTO jsonbtest (data) VALUES ('{"city":"Mesa","county":"Maricopa","mayor":"John Smith"}');
INSERT INTO jsonbtest (data) VALUES ('{"other city":"Mesa but with a longer name","county":"Maricopa","mayor":"John Smith Jr"}');


you can get the key-value pairs by doing

SELECT (jsonb_each_text(data)).* FROM jsonbtest;

    key     │   value    
────────────┼────────────
 city       │ Mesa
 mayor      │ John Smith
 county     │ Maricopa
 mayor      │ John Smith
 county     │ Maricopa
 other city │ Mesa
(6 rows)


Having this, getting the maximal length is a matter of a simple GROUP BY query:

SELECT key, max(char_length(value))
  FROM (SELECT (jsonb_each_text(data)).* FROM jsonbtest) t 
 GROUP BY key;

    key     │ max 
────────────┼─────
 city       │   4
 other city │  27
 county     │   8
 mayor      │  13
(4 rows)


See all this at work on dbfiddle.  See what else you cana use for processing your JSONB values in the docs.