Well, it depends exactly where in Virginia and Maryland, and when you're talking about. I hate to give an "it depends" answer on here, but really it does. For example, if this wife lives in Leesburg, and wants to visit her dad in Frederick during early September 1862, she going to have a very difficult time getting through the lines to make that trip. This journey would put the woman behind the lines of Lee's army to start, and then behind McClellan's lines at the terminus. Each side would have pickets (alternatively spelled picquets) to keep stragglers in, and spies or enemy cavalry out. Without a pass, a civilian would have a very difficult time making their way through something like this.
Throughout most of the war, while you could travel somewhat freely between the different states of the conflict, if you were approaching an army's camp or lines, things got more difficult. What was more difficult was getting to a Southern port via boat, as the Union blockade did indeed force people looking to enter the Confederacy by sea to get creative. Many came up through Texas or Mexico (see Arthur Freemantle for more on that) to get around the blockade.
As the war went on, and the Confederacy's military area of influence shrank, it became easier to travel between the states. John Wilkes Booth is actually a very interesting and relevant example for the purpose of this question. He moved freely between Maryland, Virginia, and Washington City (what D.C. was known as in those days), and only had to contend with patrols monitoring borders and popular travel routes after Lincoln's assassination, when Stanton put the whole region on lock-down. Even with that dragnet out, Booth had a pretty easy time traversing the countryside and avoiding Union patrols. Granted, by this point, Lee had surrendered, and there wasn't much need to keep folks from moving around this region (out west was a different story), but even prior to Lee's surrender, in March and April 1865, unless you were trying to get in and out of Richmond or Petersburg, it was easy enough to get between places like Virginia and Maryland without much harassment.
TD;LR - it would have been easy-ish as long as the person wasn't crossing military encampments or bodies. If traveling near armies in an active theater of war, it would have indeed been difficult without proper paperwork (a pass).
[Sources - Jay Winik, 'April, 1865'; Bruce Catton, 'A Stillness at Appomattox']