They are pretty close close in meaning. "When" is more general and versatile as it puts fewer constraints on usage. "I was studying when she came here." is a perfect construction. It may suggest that her arrival might have interrupted your studying, but not necessarily. "When" justs sets up a time reference with respect to which the action in the main clause takes place.
"As" is slightly more restrictive as it usually suggests that the actions in the main clause and in the subordinate take place in the same time or at least they overlap in some extent. It is somewhere between "while" and "when", likely closer to the former. So you are probably better off with "She came here as I was studying."