The difference is quite simple: bien is an adverb, while bueno/a is an adjective.
You should use bien when it stands alone (esto está bien), when it modifies verbs, specially the participle (esto está bien escrito) or as an intensifier, more or less equivalent with muy (lo tenemos bien difícil, equivalent to lo tenemos muy difícil).
You should use bueno/a when it modifies a noun (era un hombre bueno); if it goes before the noun in masculine singular, bueno becomes buen (era un buen hombre).
After the verb estar, both words are usable, but with different meanings. Unfortunately, the meaning can change between countries. Está bueno in Spain usually means it tastes good, while in some American countries means it is good. Está bien in Spain means it is well done or he feels good, but in some American countries this meaning may change.